『QT』about click mouse to select the sprite(image)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
poorenglish
Prole
Posts: 47
Joined: Thu Sep 24, 2009 1:49 pm

Re: 『QT』about click mouse to select the sprite(image)

Post by poorenglish »

modify the AnAL.lua
get the get getImageData()function support.
I don't know why can't cover to *.love file.
Attachments
testclick.zip
anim for click
(4.69 KiB) Downloaded 96 times
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: 『QT』about click mouse to select the sprite(image)

Post by coffee »

poorenglish wrote:modify the AnAL.lua
get the get getImageData()function support.
I don't know why can't cover to *.love file.
You should ask about AnAL implementation or problems in the library thread
viewtopic.php?f=5&t=948
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: 『QT』about click mouse to select the sprite(image)

Post by TechnoCat »

If it works as loose files and not as a love file and you are Windows. Then your capital/lower case letters are wrong most likely.
poorenglish
Prole
Posts: 47
Joined: Thu Sep 24, 2009 1:49 pm

Re: 『QT』about click mouse to select the sprite(image)

Post by poorenglish »

Work fine when I use the SciTE.
It seems the newFramebuffer error when create .love file.
attempt to call field 'newFramebuffer' <a nil value> stack traceback:
same found in the viewtopic.php?f=4&t=3891&p=39065&hilit= ... fer#p39065
I does not update the love to 0.80 version.
Work fine on the my another computer.
Attachments
AnAL_M2.love
error newframebuffer.
(4.38 KiB) Downloaded 88 times
Last edited by poorenglish on Mon Feb 06, 2012 11:57 am, edited 1 time in total.
User avatar
ston
Prole
Posts: 21
Joined: Fri Jan 27, 2012 9:53 am
Location: Holt, a small village in Wiltshire. We have cider!

Re: 『QT』about click mouse to select the sprite(image)

Post by ston »

coffee wrote: Nice, your Z-code works but you probably have something wrong eating memory or infinite looping. I change and move some circles but some time after always crash.
Morning :-)

It's some combination of mouse clicking which seems to upset it; if you just leave it alone it's stable. I need to understand more about love's theading model and what, if any, synchronisation needs to be done in the lua script. Anyway, hopefully it was of some help.

[edit] Think I've found the BUG now, if the mouse is released whilst these two lines of code are being executed in the mousepressed event handler:

table.remove(t, i)
table.insert(t, this_layer)

...then there's a window of opportunity for the mouse released code to run after the .remove call, but before the .insert, so the table won't then have an item at index [10]. I added a global 'm_pressed' flag which I set to true at the start of mousepressed() and false at the end. Then in mousereleased() I added:

Code: Select all

	
while m_pressed do
    love.timer.sleep(1)
end
...before the call to 'unbind' the top level circle. That seems to have done the trick.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: 『QT』about click mouse to select the sprite(image)

Post by Robin »

ston wrote:[edit] Think I've found the BUG now, if the mouse is released whilst these two lines of code are being executed in the mousepressed event handler:

table.remove(t, i)
table.insert(t, this_layer)

...then there's a window of opportunity for the mouse released code to run after the .remove call, but before the .insert, so the table won't then have an item at index [10].
Ehm... I think not. LÖVE is not multithreaded (at least, unless you're using love.thread, but it doesn't sound like it), so handlers are run sequentially, not asynchronously.
Help us help you: attach a .love.
User avatar
ston
Prole
Posts: 21
Joined: Fri Jan 27, 2012 9:53 am
Location: Holt, a small village in Wiltshire. We have cider!

Re: 『QT』about click mouse to select the sprite(image)

Post by ston »

Robin wrote: Ehm... I think not. LÖVE is not multithreaded (at least, unless you're using love.thread, but it doesn't sound like it), so handlers are run sequentially, not asynchronously.
Ah, thx for the info. Another theory bites the dust :)
Post Reply

Who is online

Users browsing this forum: No registered users and 56 guests