PureBasic Forum
http://forums.purebasic.com/english/

How to sineflag
http://forums.purebasic.com/english/viewtopic.php?f=10&t=39068
Page 1 of 1

Author:  xperience2003 [ Mon Sep 14, 2009 9:39 pm ]
Post subject:  How to sineflag

Image

Code:
;************************************
;*******      SINUSPIC      *********
;************************************
InitScreen(0)
InitBitMap(2)
initpicture(0)
InitPalette(0)
*TagList = InitTagList(40)

AllocateBitMap(1,320,256,4)
AllocateBitMap(0,320,256,4)

ResetTagList(#SA_Type, #CUSTOMSCREEN | #CUSTOMBITMAP)
      AddTag(#SA_Quiet, 1)
      AddTag(#SA_BitMap, BitMapID())
      ;AddTag(#SA_Draggable, 0)
      OpenScreen(0, 320, 256, 4, *TagList)
   
 ;we load the picture
  AllocateBitMap(2,113,135,4)
  LoadPicture(0,"dat/face.iff")
  PictureToBitMap(0, BitMapID())
   
  GetPicturePalette(0,PictureID())
  DisplayPalette(0,ScreenID())

  DB=1

  Repeat
    ;VWait()
    ShowBitMap(DB,ScreenID(),0,0)
   
    DB=1-DB
   
     UseBitMap(DB)
     drawingoutput(bitmaprastport())
     Cls(0)     
     UseBitMap(2)
     For y=0 To 130 Step 5
       sini+1
       If sini>360:sini=0:EndIf
       sinus=PeekL(?sintable+(sini*4))
       CopyBitMap(BitMapID(),0,y,50+sinus/20,y,112,5)
     Next

    mb.w=mouseButtons()
  Until mb.w=2
 
  End

DisableDebugger
sintable:
IncludeBinary "dat/sintable"
EnableDebugger


files and sources here
download 10kb

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/