Actions
Bug #852
openActor dose not maintain modified Hrev property value
Start date:
10/14/2021
Due date:
% Done:
0%
Estimated time:
Affected version:
Description
In the following example I'm trying to control an Arrow with the Left/Right keys.
I added OnChange
event listener to modify the correct Hrev of the Actor: Actor "arrow", hrev=(int(X) < previousX)
During the key press the Actor change the Hrev correctly, but as soon as the key release Actor restore the Hrev to the previous value
Full code:
Global previousX
Actor "arrow", Image$="arrow",x=800,y=300, Scale=0.25, \
Control$="ArrowRight: offsetX = 18; ArrowLeft: offsetX = -18", \
LeftLimit=400, RightLimit=Screen Width + 60 ,OnChange$="onArrowMove"
do
Wait Vbl
Loop
Procedure onArrowMove [EVENT$,INDEX$,X]
if x<>previousX then log "previousX="+str$(previousX)+ Str$(Int(X) < previousX) +" " + EVENT$
Actor "arrow", hrev= (int(X) < previousX)
previousX=Int(X)
End Proc
Attached the code with the images.
Files
No data to display
Actions