Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
RenderTarget Bug? — Gideros Forum

RenderTarget Bug?

antixantix Member
edited April 2016 in Bugs and issues
I am drawing 2 bitmaps to a RenderTarget. Before drawing each bitmap I clear the area where it will be positioned inside the RenderTarget. This is causing some issues as some areas outside the bounds of my clear are being cleared. In the image attached you can see the yellow area which should not be filled, but somehow it is.

Can anyone tell me if I'm doing something wrong or if there is a bug in RenderTarget clear?
local bitmap, x, y
 
local atlas = RenderTarget.new(1536, 1536)
 
x, y = 512, 0
bitmap = Bitmap.new(Texture.new("blue.png", true))
print("blue, x="..x..", y="..y..", w="..bitmap:getWidth()..", h="..bitmap:getHeight())
atlas:clear(0x008888, 1, x, y, bitmap:getWidth(), bitmap:getHeight())
bitmap:setPosition(x, y)
atlas:draw(bitmap)
 
x, y = 0, 512
bitmap = Bitmap.new(Texture.new("red.png", true))
print("red, x="..x..", y="..y..", w="..bitmap:getWidth()..", h="..bitmap:getHeight())
atlas:clear(0x888800, 1, x, y, bitmap:getWidth(), bitmap:getHeight())
bitmap:setPosition(x, y)
atlas:draw(bitmap)
 
bitmap = Bitmap.new(atlas)
bitmap:setScale(320 / 1536)
stage:addChild(bitmap)
RTBug.png
336 x 540 - 5K
zip
zip
RTBug.zip
2K

Comments

Sign In or Register to comment.