Main Menu

Simple Shape Editor

Started by kevin, April 25, 2006, 10:31:42 AM

Previous topic - Next topic

kevin

Just throwing this together tonight.  At the moment, you can load an image, create an polyline outline of the image.  The screen can be scaled to make placement easier.   The controls are pretty simple (left click places a new vertex) arrows control the scale.  and that's about robust as it'll get for the time being.

Edit:  See PlayShape for current version of this tool.




thaaks

Looks like it has been (still is?) a productive night!

Maybe adding right click to delete a vertex and some shortcut key to close the shape by adding a line from the last vertex to the first.

That will be a great help for advertising (nearly) pixel perfect collisions in a fast way.

Just curious: Do you also have a full time job or are you some freelancer? And how do you stay focused on the PlayBasic tasks? Or are you the first australian artificial intelligence living on some server farm and code PlayBasic for fun while solving mankind's problems?  :D

Hats off,
Tommy

kevin

#2
QuoteLooks like it has been (still is?) a productive night!

  About an hour 1/2 into it.   Tonight is about all this revision gets.  


QuoteMaybe adding right click to delete a vertex and some shortcut key to close the shape by adding a line from the last vertex to the first.

 Atm, del removes the last point.    


QuoteJust curious: Do you also have a full time job or are you some freelancer?

  I'm drummer by trade, but these days I just teach from home. Teaching is just part time these days though, slowly scaling it back  as UW grows.


QuoteAnd how do you stay focused on the PlayBasic tasks?

  I'm just pushing the boulder.  Every little bit of effort brings the end that little bit closer.    Generally, I guess this is the type of programming I enjoy.  Quick and easy.

kevin

Here's the next shot,  the basic editing working now.   The picture shows the created shape alphed to over the image.    The program is setup to merge various poly lines into a main shape as you add them.  So from here i can create another polyline and then merge it with the existing shape.   This allows you to hollow things out

Creating the outline takes about 40 seconds. So It's pretty simple stuff !  Whats missing is some editing ability of the outline.  So at the moment you can't go back and move a vertex, or insert or delete a vertex.

The shapes will be shaped using ther shape Slib.   Hence To load them, you just include Shape sib and called "loadShape"

kohai

Wow that's great !

I can start working on a mini sh'mup now ^^

kevin


kevin


thaaks

Ooh, a new command LoadShape...and binary shape files...nice  ;)

kevin

QuoteOoh, a new command LoadShape...and binary shape files...nice  ;)

Yeah, it was new about 6/7 months ago :)

Most of the slibs have save/loaders as well as file stream versions. So you can actually wrap and stream the data into your own pack files.  Which is how my version of PlayMapper works for example.

thaaks

QuoteYeah, it was new about 6/7 months ago :)
:blink:  Note to self: must learn to look for slibs...and don't post too soon...
QuoteMost of the slibs have save/loaders as well as file stream versions. So you can actually wrap and stream the data into your own pack files.  Which is how my version of PlayMapper works for example.
I will have a look at this streaming stuff. Sounds interesting.

kevin

#10
I figured it could be handy for some people.   The again, it'd nice to have version that could read/write from an address, bank etc etc version.  But hey, that's something for the user :)

kevin

#11
Still playing around with this, mostly added the editing functions.  Very tempted to throw a bit of GUI on it.  The down side would not doubt be that simple 'as is' tool could easily blow out into be time hungry project.  Really don't have time for that atm.

 Since this tool is for collision mainly (but i guess you could draw shapes with it if you wanted.)  You don't actually (at this time) edit the shape directly.  Rather, you edit a POLY LINE list.  The verts in the polyline list are expected form a closed concave polygon. These points should be order CLOCKWISE...

 Once you have your area defined how you want it, you then merge this Polyline with the collision Shape.    You can keep doing this as many times as needed.   So you can define various areas that are solid, areas inside areas etc.

 It's not most the flexible tool in the world and i can think of a MANY features that would be handy to have in, that are missing, but it works.  

 This piccy shows the collision shape built from various polylines.

Ian Price

#12
Cool B)
I came. I saw. I played some Nintendo.

kevin

#13
Version 0.03

   Ok, I couldn't let this go out without cleaning it upt.   So i've added some GUI elements.  Couldn't resist.    I've also integrated support for importing those raster to vector (TXT) polyline files.   Which is what this picture shows.   The import support if far from fail safe, or user friendly at this point,  but it's something.  Anything more will have to be explored later

  I'm going to have to wrap this up within the next few hours. If we are to make the next demo deadline.