Prograss Bar Behavior.
should assign it to a bitmap sprite.
support border settings.
step function:Step(StepValue)
set position function:SetPos(PosValue)
get percent variable :sprite(ThisSprite).Percent
on prepareFrame me
--SetPos(me,PBPos+1)
Percent=integer((PBPos-PBMin)*100/(PBMax-PBMin)*1.00)
end
on endSprite me
PBMember.image=OldImage
end
---
on Step me,FStep
if PBPos+FStep<=PBMax and PBPos+FStep>=PBMin then
PBPos=PBPos+FStep
else
if PBPos+FStep>PBMax then PBPos=PBMax
if PBPos+FStep end if
TWidth=(PBPos-PBMin)*(OldImage.width-bordervalue*2)/(PBMax-PBMin)*1.00
TRect=rect(bordervalue,bordervalue,TWidth+bordervalue,OldImage.height-bordervalue)
TRect2=rect(TWidth+bordervalue,bordervalue,OldImage.width-bordervalue,OldImage.height-bordervalue)
PBMember.image.copyPixels(OldImage,TRect2,TRect2)
PBMember.image.fill(TRect,[#lineSize:0,#color: PBColor])
end
on SetPos me,FPos
if FPos<=PBMax and FPos>=PBMin then
PBPos=FPos
else
if FPos>PBMax then PBPos=PBMax
if FPos end if
TWidth=(PBPos-PBMin)*(OldImage.width-bordervalue*2)/(PBMax-PBMin)*1.00
TRect=rect(bordervalue,bordervalue,TWidth+bordervalue,OldImage.height-bordervalue)
TRect2=rect(TWidth+bordervalue,bordervalue,OldImage.width-bordervalue,OldImage.height-bordervalue)
PBMember.image.copyPixels(OldImage,TRect2,TRect2)
PBMember.image.fill(TRect,[#lineSize:0,#color: PBColor])
end
---
on getPropertyDescriptionList
vPDList = [:]
set num=the memberNum of sprite the currentspritenum
setaProp vPDList, #PBColor, [#comment: "Color",
#format: #color, #default:rgb(28,7,143)]
setaProp vPDList, #PBMin, [#comment: "Min Value",
#format: #integer, #default:1]
setaProp vPDList, #PBMax, [#comment: "Max Value",
#format: #integer, #default:100]
setaProp vPDList, #StartPos, [#comment: "Start Value",
#format: #integer, #default:1]
setaProp vPDList, #BorderValue, [#comment: "Border Value",
#format:#integer , #default:1,#range: [#min:0, #max:5]]
setaProp vPDList, #BorderType, [#comment: "Border Type",
#format:#string , #default:"Down",#range: ["None", "Down","Up","Rect"]]
return vPDList
end getPropertyDescriptionList
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA