dualPlayfield()
Enable or disable screen overlay over sprite layer. dualPlayfield command allows you to show foreground graphics over background and sprites layers. By moving foreground layer faster than background, you can achieve interesting parallax effects. This command work in conjunction with transparent screens. See screenOpen() command on how to set screen transparency.
Syntax:
dualPlayfield( value )
value = 0 means dualPlayfield disabled
value = 1 means dualPlayfield enabled
by default value is set to 0
Example:
dualplayfield( 1 )
screenopen(0,1280,480,0,0,640,480,0) 'background screen
for i = 0 to 50
ink(rgb(rnd(255),rnd(255),rnd(255)))
line(rnd(1280),rnd(480),rnd(1280),rnd(480))
next
screenopen(1,2560-640,480,0,0,640,480,3):'foreground screen
for i = 0 to 50
ink(rgb(rnd(255),rnd(255),rnd(255)))
text(rnd(2560-320),rnd(480),rnd(64),"foreground screen")
next
x1=0:x2=0
while x1<640
x1+=1
x2+=2
screen(0):offset(x1,0)
screen(1):offset(x2,0)
waitvbl
end while
Example:
dualplayfield.sdlbas
See also screenOpen() command.