Adam's Lair Forum

game development and casual madness
It is currently 2018/11/21, 04:45

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: [Plugin] Pixmap Slicer
PostPosted: 2018/05/06, 03:44 
Novice Member
Novice Member

Joined: 2016/01/04, 05:33
Posts: 14
Role: Hobbyist
Hello everyone! I've recently started work on a plugin that will make it easier to define sprite rectangles within a texture.

In Duality currently, your sprite sheets have to be laid out in a nice grid to have Duality split it up for you or you need to enter the rectangle coordinates manually. My plugin, Pixmap Slicer, will allow you to automatically slice a texture or to define rectangles with your mouse.

Before:
Image

After 1 Click:
Image

Note that in the above images each sprite has some nearly transparent pixels around it that are causing the rectangles to seem too large. Pixel Slicer supports a cutoff value that would make the rectangles fit much tighter to the individual sprites.

Current Features (with a few minor bugs):
Auto-Slice with configurable alpha cutoff
Clear all rectangles
Resize rectangles with mouse
Zoom/Pan Image

Planned Features:
Create new rectangles with mouse
Rectangle drag-and-drop
Auto-grid from the Pixmap Slicer window
Rectangle Ordering


I don't have this up on Nuget yet, but it is hosted on GitHub.

What do you all think? Is there a feature you would like to see from a plugin such as this?


References:
Images licensed CC BY 3.0 by Chabull at opengameart.org (http://opengameart.org/users/chabull)


Top
 Profile  
 
PostPosted: 2018/05/06, 08:23 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 880
Location: Italy
Role: Hobbyist
Yassss :+1:

if you also were to be able to define animation chains inside that UI, like this
Image

it would be extremely useful (to me at least :mrgreen: )

Oh, and maybe give a name to each sprite/animation?

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2018/05/06, 09:21 
Novice Member
Novice Member

Joined: 2016/01/04, 05:33
Posts: 14
Role: Hobbyist
SirePi wrote:
Yassss :+1:

if you also were to be able to define animation chains inside that UI, like this
Image

it would be extremely useful (to me at least :mrgreen: )

Oh, and maybe give a name to each sprite/animation?


Well when it comes to defining rect ordering I was thinking of something where you would click them in the order that you wanted them to be listed. That could get you something close to your first suggestion.

Doing the second one would need a custom resource that maps names to sprites or sequences of sprites. Should be do-able as well, just need to make sure it is user friendly enough since you would be working with two resources then. Another option, although I don't know if it's possible, would be to create a resource that derives from Pixmap.

We'd also want it to integrate cleanly with AnimSpriteRenderer if possible.

Thanks for the suggestions!


Top
 Profile  
 
PostPosted: 2018/05/06, 10:17 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2063
Location: Germany
Role: Professional
This looks really good :)

Would you be open for integrating this into the Duality core directly as a contribution? It actually looks so useful I wouldn't want to miss it by default, and I think the EditorBase plugin would be a nice place to host this.

Let me know if you're interested, either here or in the chat. Either way, nice work :1+:

Quote:
Doing the second one would need a custom resource that maps names to sprites or sequences of sprites. Should be do-able as well, just need to make sure it is user friendly enough since you would be working with two resources then. Another option, although I don't know if it's possible, would be to create a resource that derives from Pixmap.


Pixmap atlas definitions are rudimentary at best right now - I'd be open to extend them to allow for a collection named sequences or similar.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group