Wednesday, October 21, 2015

Mathematical Flower

BMP IDE ကို အသံုးျပဳ ၿပီး Mathematical Flower ေလး တခု ေရးဆြဲၾကည့္ရေအာင္။  :)

=================
Main
=================

Addimage("img",0,0,windowwidth,windowheight-50,"")

AddLabel("lbl",0,windowheight-50,windowwidth,50,"")
SetText("lbl","Mathematical Flower by Nyi Nyi Lwin")

canvasinit("img")
drawColor(cyellow)

centerx=windowwidth/2
centery=windowheight/2

x=0
y=0
a=0
a2=0
a3=0

b=0
r=0
g=0
col=0

SetTimerInterval(10)
SetTimerEnabled(true)

=============
Events
=============
Sub Activity_Pause(UserClosed)
End Sub

Sub Activity_Resume
End Sub

Sub Timer_Tick

a=a+0.01
a2=a2+0.06
a3=a3+0.09

if a>6.28 then
a=0
end if

if a2>6.28 then
a2=0
end if

if a3>6.28 then
a3=0
end if

x=sin(a)*200+cos(a2)*100+centerx
y=cos(a)*200+sin(a2)*100+centery

r=128+sin(a)*127

g=128+sin(a2)*127

b=128+sin(a3)*127

col=argb(255,r,g,b)

drawcircle(x,y,50,col,true,1)
invalidate("img")

End Sub

==============

No comments:

Post a Comment