Browsing for sprites

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Browsing for sprites

Post by Bob the Hamster »

Coming in tomorrow's wip builds, it is now possible to browse for sprites rather than typing in their ID numbers

Hero and portrait browsing:
Image

Attack browsing... may cause seizures?

Image

Is exploiting the "Shrink" Dissolve type in Custom going to come back to bite me on the bum?

Image
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

looks sliming amazing

<3
Last edited by SwordPlay on Wed Sep 13, 2017 12:38 am, edited 8 times in total.
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Post by Foxley »

Just wow. The work you and TMC have been doing lately with the UI has been astonishing.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Wasn't expecting this; nice! I'm planning a tiled interface for the new spriteset editor too.
Is exploiting the "Shrink" Dissolve type in Custom going to come back to bite me on the bum?
Oh is that what you did? Ah, that explains why the browser runs at 1.3 fps on my netbook :P I had assumed that you'd used the routine I wrote for scaling a surface (scale_surface()). But I guess I didn't merge any of the branches where I actually use it, for you to use as an example.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Aha! I didn't realize scale_surface was there. I can give it a try tomorrow.
User avatar
guo
Metal Slime
Posts: 749
Joined: Fri Dec 04, 2009 9:12 pm

Post by guo »

Holy frijoles.
vvight.wordpress.com
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

The way to use surface_scale is entirely non-obvious. I think you'll be surprised at what's going on!

Hmm, we actually have three different ways to scale a sprite. And all of them have major problems/shortcomings. Even though it feels messy, I guess I'll pick surface_scale and build sprite scaling into the slice system for convenience, although it means it can't be exposed to users, yet, due to bitdepth thing.
Last edited by TMC on Wed Sep 13, 2017 2:46 pm, edited 2 times in total.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I was looking at surface_scale's usage in browse.bas, and yes, that is a doozy!

Code: Select all

  DIM as Surface ptr temp = surface_import_bmp&#40;filepath, YES&#41;  'always_32bit=YES
  '? "import32 in " & &#40;TIMER - t&#41;
  't = TIMER
  DIM ratio as double = 1.0
  WITH br.preview_panel_size
   IF temp->width > 0 THEN ratio = small&#40;1.0, small&#40;.w / temp->width, .h / temp->height&#41;&#41;
  END WITH
  surface_assign @temp, surface_scale&#40;temp, temp->width * ratio, temp->height * ratio&#41;
  '? "shrink in " & &#40;TIMER - t&#41;
  br.image_preview = frame_with_surface&#40;temp&#41;
  gfx_surfaceDestroy&#40;@temp&#41;
But it seems like there is no reason we couldn't have a convenience wrapper overload that ends up being used like:

Code: Select all

br.image_preview = surface_scale&#40;surface_import_bmp&#40;filepath, YES&#41;, ratio&#41;
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Oh, I beat you to it.
Yes, all the Frame<->Surface stuff is nasty and I'm really unhappy with the current API, which is temporary (I'm going to merge those two UDTs to do away with it all).
But that's not what I was referring to; I meant sneaking in the use of 32-bit surfaces and vpages!
User avatar
Spoonweaver
Liquid Metal King Slime
Posts: 6462
Joined: Mon Dec 08, 2008 7:07 am
Contact:

Post by Spoonweaver »

Looks cool.

Much better than shoving graphics into heroes to seem them animate.
User avatar
Sparoku
Metal Slime
Posts: 309
Joined: Tue Jun 18, 2013 3:19 pm
Location: Dairy Queen
Contact:

Post by Sparoku »

Oh, that's awesome!! :o
"One can never improve enough nor should one stop trying to improve."
User avatar
FnrrfYgmSchnish
Metal Slime
Posts: 741
Joined: Thu Jun 18, 2009 4:37 am
Location: Middle of Nowhere

Post by FnrrfYgmSchnish »

Seizurrific as it may be, being able to browse for attack graphics looks like it would REALLY come in handy, especially for games with lots of them! Always nice to see really useful stuff getting added.
FYS:AHS -- Working on Yagziknian NPC walkabout sprites
Post Reply