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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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