Commit e82d6f01 authored by Olimaticer's avatar Olimaticer

2018-03-31

parent 4debd8a0
Rem Basic! program. PunchingTransparency.bas
FN.DEF maskBmp(bmp, stepSize, mr,mg,mb)
GR.BITMAP.SIZE bmp,x,y
GR.COLOR 0,0,0,0
FOR i = 0 TO x-1 STEP stepSize
FOR j = 0 TO y-1 STEP stepSize
GR.GET.BMPIXEL bmp,i,j,a,r,g,b
IF r=mr & g=mg & b=mb THEN GR.BITMAP.FILL bmp, i,j
NEXT
GR.RENDER
NEXT
FN.END
GR.OPEN 250,20,30,150,0,1
dy = 25
nr = 70
FOR i=0 TO nr
GR.COLOR 255, 255/nr*i, 30, 60 ,1
GR.RECT nn, 0,i*dy,1200, i*dy+dy-3
GR.RENDER
NEXT
GR.BITMAP.CREATE mask,500,500
GR.BITMAP.DRAW tmp,mask,100,400
mr = 244
mg = 246
mb = 10
GR.BITMAP.DRAWINTO.START mask
GR.COLOR 255, 20,30,60,1, ,-1
GR.RECT nn, 0,0,500,500
GR.COLOR 190, mr,mg,mb,1, ,0
GR.TEXT.SIZE 160
GR.TEXT.BOLD 1
!GR.SET.ANTIALIAS 0
GR.TEXT.DRAW nn, 10,150 ,"BASIC!"
GR.TEXT.DRAW nn, 200,310, "For"
GR.TEXT.DRAW nn, 30,490 ,"Ever"
!GR.SET.ANTIALIAS 1
GR.BITMAP.DRAWINTO.END
GR.RENDER
! CALL maskBmp(mask,20,mr,mg,mb)
speed = 0.66
DO
phi = TORADIANS(speed*t++)
GR.MODIFY tmp,"y" , SIN(phi)*400+400
GR.MODIFY tmp,"x" , COS(phi)*1
\ No newline at end of file
REM Start of BASIC! Program. porterDuff.bas
FN.DEF mPro(i)
GR.CLS 1 % All bitmaps are deleted too
GR.BITMAP.LOAD bpo, "cartman.png"
GR.BITMAP.SCALE bp, bpo, 240, 240
GR.BITMAP.CREATE destiRect, 400, 400
GR.BITMAP.DRAWINTO.START destiRect
GR.COLOR 100, 0, 155,0,1%, , -1
GR.RECT dRbG, 0,0,300,300
GR.COLOR 255, 0, 0,255,1%, , -1
GR.RECT dR, 0,0,200,200
GR.BITMAP.DRAWINTO.END
GR.BITMAP.CREATE destinaton, 600, 800
GR.BITMAP.DRAW tmp,destinaton,100,100
GR.BITMAP.DRAWINTO.START destinaton
! Create the destination contens
GR.COLOR 255, 0, 0,255,1%, , -1
GR.BITMAP.DRAW cm1, bp, 0, 0
GR.BITMAP.DRAW tmp2, destiRect,400,100
GR.RECT nn, 0,400,400,800
! Now the source
GR.COLOR 255, 255, 0,0,1, , i
GR.BITMAP.DRAW cm1, bp, 80, 80
GR.CIRCLE cc, 400, 400, 200
!gr.render
GR.BITMAP.DRAWINTO.END
GR.COLOR 255, 0, 100,100,1%, ,-1
GR.TEXT.SIZE 50
GR.TEXT.DRAW tp, 100, 950, STR$(i)
GR.TEXT.DRAW tp, 100, 1050, "<<<"
GR.TEXT.DRAW tp, 600, 1050, ">>>"
GR.RENDER
FN.END
DEVICE dbp
BUNDLE.GET dbp, "OS" ,myOs$
bgCam = 0
IF val (LEFT$(myOs$,1)) > 5 THEN bgCam = 1
GR.OPEN 0,255,255,255,1, 1, bgCam
i = -1
mPro(i)
DO
UNTIL 0
ONGRTOUCH:
GR.LAST.TOUCH lin, xt, yt
IF xt < 350
i = MAX(--i,-1)
ELSE
i= MIN(++i,17)
ENDIF
mPro(i)
GR.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment