Jump to content

Render texture bigger pixels.


l8figure
 Share

Recommended Posts

How to make a renderTexture with bigger pixels?

i want the "pixel" to be the actual size of the pixel, is that possible?

   let rt = this.add.renderTexture(0010001000);
    
    this.input.on('pointermove'function (pointer) {
 
        if (pointer.isDown)
        {
            rt.draw('pixel'pointer.xpointer.y);
        }
 
    }, this);
 
Link to comment
Share on other sites

  • 2 weeks later...

What is your 'pixel' key referring to? It doesn't look like the RenderTexture's draw method takes a string for the first argument.

You can create an Image or Sprite with the 'pixel' key if it refers to a loaded texture. You should then be able to adjust the scale and pass that instance into rt.draw()

Something like:

// created in create()
const pixel = this.make.image({ key: 'pixel' }, false)

// update the scale to get the size you want
pixel.setScale(2)

// then later in the mouse pointermove handler...
rt.draw(pixel, pointer.x, pointer.y)

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...