Project

General

Profile

Bug #851

Actor loses its "LeftLimit" & "RightLimit" when it is modified in event procedure

Added by Ronen Malka over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
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.
The Actor behaved as expected and was limited correctly.

I added OnChange event listener to modify the correct Hrev of the Actor: Actor "arrow", hrev= (int(X) < previousX)
Now the limits does not work anymore.

I also tried adding the limits strictly in the event procedure:
Actor "arrow", hrev= (int(X) < previousX),LeftLimit=400, RightLimit=Screen Width + 60
but this also did not work.

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 [X]
    Actor "arrow", hrev= (int(X) < previousX)
    previousX=Int(X)
End Proc

Attached the code with the images.


Files

tst123.zip (8.29 MB) tst123.zip code + images to reproduce. Ronen Malka, 10/14/2021 07:32 PM

No data to display

Also available in: Atom PDF