|
Lingo Tutorial: Widescreen READING:Manual pages of the commands described here File "wideScreen.dir"Moving the cursor to the left or the right border of the screen will move the background image to reveal its hidden sides.
on exitFrame me
-- Moving the cursor to the left or right side of the screen
-- (within 10 pixels from the screen border), reveals the larger picture
-- screen size is assumed 320 by 240
if (the mouseH < 10 and sprite(1).locH >0) then
sprite(1).locH = sprite(1).locH - 5
end if
if (the mouseH > 310 and sprite(1).locH < 320) then
sprite(1).locH = sprite(1).locH + 5
end if
end
Do you like the way the background screen is moving? Notice that there is something unnatural with the movement of corto maltese in the background. How do you fix it? The movement would be more believable if you had the right cursor indicate the kind of scrolling you are expecting. Add the appropriate cursor in your solution. In an earlier tutorial we learned how to move an item around using the movableSprite property. Here is another way of picking up and moving an image around without using the 'moveableSprite' property. It can be used in conjunction of other code (like monitoring the degree of movement, etc.)
-- clicking and dragging the image will allow moving it around.
on mouseDown me
global moving
sprite(1).loc = the mouseloc
moving = 1
end
on mouseWithin
global moving
if moving = 1 then
sprite(1).loc = the mouseloc
end if
end
on mouseUp
global moving
moving = 0
end |
|
|
Maintained By: Takis Metaxas
|
|