RenderToScreen
RenderToScreen
 
Parameters: NONE
Returns: NONE
 

      RenderToScreen will ensure that playBASIC directs all of it's drawing operations like Text,Images,Sprites etc to the screen.

      It's important to remember that the screen is double buffered, meaning that it consists of two copies of itself, so theres a FRONT and BACK copy. The FRONT copy is the visible version, while the BACK is the version that RenderToScreen is redirecting our drawing to. Use SYNC to copy the Back Screen to the Front visible screen.




FACTS:


      * When speaking of drawing to the Screen, we're always referring to drawing to the BACK screen. You can not draw to the FRONT version of it. (that would make the drawing flicker really badly)

      * The screen can be accessed as Image #0. So RenderToScreen is the same RenderToImage 0.

      * Use GetSurface to request find what the current surface PlayBASIC is drawing to (Screen or Image)




Mini Tutorial:


      Create an temp image, redirect all draw to it, render some circles on that image, then restore rendering back to the scree.

  
; Make an Image 200x by 300y in size
  CreateImage 1,200,300
  
; Tell PB to redirect all drawing commands to an image
; and not the screen..
  RenderToImage 1
  
; Draw some random circles on image #1
  For lp=1 To 100
     Circle Rnd(200),Rnd(300),Rnd(10) ,Rnd(1)
  Next lp
  
; Redirect ALL Drawing to the BACK Screen
  RenderToScreen
  
; Clear the Screen to a blue colour
  Cls RGB(0,0,255)
  
; Draw image #1 (the one we just created) to the screen
  DrawImage 1,300,100,0
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  



 
Related Info: GetSurface | RenderToImage | Sync :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com