What exactly is wrong with this line? :
MakeButton(1, #SIMPLEBUTTON, 0, 0, 100, 100, {OnMouseDown = p_DialRotLeft})
Hollywood 9 says the usage/ parameters are wrong, but I can't figure out what it is.
MakeButton Error
Re: MakeButton Error
I think you need to check the rest of your script
Even just adding an empty function will make it run withot errors. Perhaps your function name is misspelled or missing the ()
Even just adding an empty function will make it run withot errors. Perhaps your function name is misspelled or missing the ()
Code: Select all
Function p_DialRotLeft()
EndFunction
MakeButton(1, #SIMPLEBUTTON, 0, 0, 100, 100, {OnMouseDown = p_DialRotLeft})
Re: MakeButton Error
Ibthink it is wrong error message
Makebutton only works when a bgpic is active (so no when rapagui exist for exmple)
Also these are some restriction when used between flipbuffer() (which i dont really recall atm)
Makebutton only works when a bgpic is active (so no when rapagui exist for exmple)
Also these are some restriction when used between flipbuffer() (which i dont really recall atm)
Christos
Re: MakeButton Error
Well this is the complete script (just something I'm testing out)
I don't know what I am doing wrong here... But it's probably obvious.
I don't know what I am doing wrong here... But it's probably obvious.
Code: Select all
@VERSION 9,0
/*
** Constants
*/
Const #BGCOLOR = $065686
/*
** Variables
*/
dial_min = 1
dial_max = 9
/*
** Brushes
*/
@BRUSH 1, "dial_bkg.png", {LoadAlpha = True}
@BRUSH 2, "dial.png", {LoadAlpha = True}
@BGPIC 1, "bkg.png"
/*
** Display
*/
@DISPLAY {Width = 800, Height = 600, Color = #BGCOLOR}
/*
** Script starts here!
*/
DisplayBGPic(1)
DisplayBrush(1, #CENTER, #CENTER)
DisplayBrush(2, #CENTER, #CENTER)
MakeButton(1, #SIMPLEBUTTON, 0, 0, 100, 100, {OnLeftMouseDown = p_DialRot, OnRightMouseDown = p_DialRot})
Function p_DialRot(msg)
Switch msg.action
Case "OnLeftMouseDown":
DebugPrint("Clicked rotate left")
Case "OnRightMouseDown":
DebugPrint("Clicked rotate right")
EndSwitch
EndFunction
EscapeQuit(True)
Repeat
WaitEvent
Forever
Re: MakeButton Error
You need to put the makebutton line below the function it calls.
And you probably should change OnLeftMouseDown to OnMouseDown
And you probably should change OnLeftMouseDown to OnMouseDown