Quick Links: Gideros Home | Download Gideros | Developer Guide
Clear pixel in bitmap texture...
  • MobAmuseMobAmuse +1 -1
    Member
    Think scratchcard...

    I am trying to clear a pixel (or set of pixels) in a bitmap texture that overlays another bitmap texture when I touch the screen, so that when it is cleared you can see through it to the back bitmap thus revealing prizes.

    Sounds easy I first thought, but after using Pixel method it's no good because I am limited by size of the overlay graphic dimensions and also it is too slow on real device I found anyway even with a small overlay that is scaled using pixel lib as per pixelsclown example.

    I tried the media library which works but not in the way I want at all.

    I thought there was a Texture:setPixel(value) or Texture:setPixel(alpha) but it seems not as far as I can tell?

    Stumped :P
  • hgy29hgy29 +1 -1 (+2 / -0 )
    Maintainer Accepted Answer
    You can't write to a texture, you need a rendertarget for that, and use RenderTarget:clear(color,alpha,x,y,w,h) set to a group of pixels to a specific color.
  • MobAmuseMobAmuse +1 -1
    Member
    Ah ha thanks. I shall give that a go!

    Thanks.
  • MobAmuseMobAmuse +1 -1 (+2 / -0 )
    Member
    That works great thanks! :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with OpenID

In this Discussion

Top Posters