[Gag] example JigSaw, 1% done !

Started by newdep, September 01, 2007, 04:43:54 PM

Previous topic - Next topic

newdep

Here is an example jigsaw in GS, very raw and basic!

(download both in the same directory and extract jigsaw.tgz)



(PS: the piece a1.png is missing !)



http://www.nodep.nl/downloads/newlisp/jigsaw.lsp">//http://www.nodep.nl/downloads/newlisp/jigsaw.lsp     (code)

http://www.nodep.nl/downloads/newlisp/jigsaw.tgz">//http://www.nodep.nl/downloads/newlisp/jigsaw.tgz    (Images!)



I have some remarks on this perhpas they can be cleared? ;-)





As it seems now a draw-image can only be moved by mouse-dragged when its

ontop of a canvas. An image itself does not return any tags?



When using a canvas below the Image you can see in the jigsaw.lsp example

that you see the border lines of the canvas... My question! Can Canvas get "transparent" 4

bytes color codes? instead of 3? Or is there another way to make those canvas boders dissapear?

(OR if images would return "tags" then the extra canvas is not needed and

the image itself is transparent)





How do I retrieve the gs:draw-image image size?



Tags stacking... This Jigsaw has only 9 pieces.. but using a jigsaw with 100 pieces

I need to do a whole lot of redrawing (deleting and laoding from disk)

 to get the current piece ontop of the rest, thats actualy waste of cpu ;-) I there a more clever way?





Hope to fix this jigsaw to a nicer one finaly ;-)



Regards, Norman.
-- (define? (Cornflakes))

Lutz

#1
On the Mac I only see one big black area, and nothing else, why are all tiles black?


Quote Can Canvas get "transparent" 4 bytes color codes?


yes on Mac OS X, not on WinXP, Linux don't know, Vista don't know


QuoteOr is there another way to make those canvas boders dissapear?


There is gs:window (see frameless-demo.lsp) which puts a window without any decorations. On the Mac  the demo also shows the window transparent.


QuoteOR if images would return "tags" then the extra canvas is not needed and the image itself is transparent)


Not sure I understand? The tag is transmitted through the mouse actions when clicking on them. You could then keep track of the tags their new positions pushing date on to some list.



Some sort of gs:tag-query will be implemented in the future, but keeping track of it yourself will result in a lot faster code than doing the future gs:tag-query request which involves communications between GS-Server and your application.



The current absence of tag-queries shouldn't prevent you from doing anything, but of course you would have to write some code ;-)


QuoteHow do I retrieve the gs:draw-image image size?


we will have a gs:get-image-data in the next version, Cormullion had the same question and ended up using some utility together with (exec ....) to accomplish getting image data.


QuoteTags stacking. I there a more clever way?


for the next version we could have gs:tag-order, which takes a list of ordered tags and shuffles/redraws the new order



Lutz

Lutz

#2
... now the jigsaw puzzle works nicely!



I was starting the app from newlisl-edit.lsp and it looked for the .png pics in the wrong place.



Lutz