Author Topic: AnimScreen- Make the window grow to set size, when starting up a game/program  (Read 1882 times)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1645
  • Particle Hawk
    • View Profile
First, set in editor options the program window size to be 176x220

Then:
Code: (glbasic) [Select]
loadsprite "blah,png",0
AnimScreen(800,600,4,0)
This will make a screen "grow" to 800x600 in 4 frames, with splashscreen stretching too.
Note: you wont need more itterations than 4, 4 is ok for speed and looks.

Code: (glbasic) [Select]

FUNCTION AnimScreen: x,y,ITERATIONS, spritenum
//animates the window from 176x220, to xy size.
//x=final screen width
//y=final screen height
//ITERATIONS=how many steps to animate...4 should be enough(max).
//instructions :set options in editor, window size: 176x220
//Call Example: AnimScreen(800*600)
//spritenum is splash screen sprite number to expand with window
x2=(x-176)/ITERATIONS
y2=(y-220)/ITERATIONS
FOR i =0 TO ITERATIONS
SETSCREEN 176+x2*i,220+y2*i,FALSE
STRETCHSPRITE spritenum,0,0,176+x2*i,220+y2*i
SHOWSCREEN
SLEEP 16
NEXT
ENDFUNCTION
« Last Edit: 2008-Oct-25 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)