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 parts of the hidden picture
                         
    -- screen size is assumed 320 by 240
    if (_mouse.mouseH < 10 and sprite(1).locH >0) then
       sprite(1).locH = sprite(1).locH - 5
    end if
                         
   if (_mouse.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. For example, when the cursor is on the left of the image one might expect to see more of the hidden left side (instead of hiding more of the left side). 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.

You can control whether you can click and drag a sprite by selecting the movableSprite property. Here is another way in Lingo 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 = _mouse.mouseloc
     moving = 1
 end
 on mouseWithin
     global moving
     if moving = 1 then
        sprite(1).loc = _mouse.mouseloc
     end if
 end
 on mouseUp
     global moving
     moving = 0
 end

 

Maintained By: Takis Metaxas
Last Modified: March 16, 2009