QUOTE(tto42 @ Nov 27 2004, 01:16 PM)
Hi,
have a little problem and I hope one of you can hit me with the obvious?! How can I write this function in a way so it`s working:
look_setSrcOffset(this, this.width, 0)Everything it does so far is to take 'this' and srcoff it at 0 0. I once started the look with an initial srcoff and by pressing the button it went back to srcoff 0 0. So thats working
The use should be to have an extra picture for onrightbuttondown.
I can`t use 'toggle' for buttons like Play/Pause neet that already.
Think of picture like:0
1
2 2
5
6
7 7
Now I have my mousestates Normal, Rollover, Pressed and furthermore in the second row pictures I want to use as RightButtonPressed.
The complete code looks like this
CODE
lua rightDownToggle
function onrightbuttondown(this)
look_setSrcOffset(this, this.width, 0)
end
function onrightbuttonup(this)
look_setSrcOffset(this, 0, 0)
end
endlua
I`m sure I only miss something like a bracket, but I tried everything I could think for.
Thanks for any suggestions
to42
Function look_setSrcOffset seems to not work fine. I first time use it becouse i used always look_setSrc[X/Y]. You can write this code in your lua to fix problem:
CODE
function look_setSrcOffset(this, x, y)
look_setSrcX(this,x)
look_setSrcY(this,y)
end
Or use look_setSrcX functions to set scroff. If you use lua to set scroff by pressing buttons don't forget to use all mouse possiblities (onrightbuttonup(this)/onrightbuttondown(this) is not enouth to not bugs produce).
You may define scroff in all this functions too:
CODE
-onrightbuttonupoutside(this)
-onleftbuttonupoutside(this)
-onleftbuttonup(this)
(all up must be used)