My opinion is you will get further faster if you don't worry yourself with the dfBitmapSet - its an extra layer of code that is unnecessary, but bears some resemblance to xml seen on other platforms used in a similar fashion.
You can easily create bitmaps, regions and sprites without it and you don't need to parse any XML to do it:
screen=createobject("roScreen",true,1280,720)
screen.setalphaEnable(true)
layer=1
bitmap=createobject("robitmap","pkg:/images/mm_icon_focus_hd.png")
region=createobject("roRegion",bitmap,0,0,bitmap.getwidth(),bitmap.getheight())
Compositor=createobject("rocompositor")
compositor.setDrawTo(screen,&h000000ff)
Used in a working example:
sub main()
screen=createobject("roScreen",true,1280,720)
screen.setalphaEnable(true)
layer=1
bitmap=createobject("robitmap","pkg:/images/mm_icon_focus_hd.png")
region=createobject("roRegion",bitmap,0,0,bitmap.getwidth(),bitmap.getheight())
Compositor=createobject("rocompositor")
compositor.setDrawTo(screen,&h000000ff)
mySprite=compositor.newSprite(100,100,region,layer)
while true
mysprite.MoveOffset(1,2)
if mysprite.getx() > 1280 then
mysprite.moveto(0,mysprite.gety())
end if
if mysprite.gety() > 720 then
mysprite.moveto(mysprite.getx(),0)
end if
compositor.drawall()
screen.swapbuffers()
end while
end sub
For memory management purposes, you should know how to un-create sprites, bitmaps and regions as well:
MySprite.remove()
region=invalid
bitmap=invalid
screen.swapbuffers()
- Joel
- Joel