Search the Community
Showing results for tags 'repeating'.
-
Hi there I'd like to know if there is a builtin way to draw to a canvas "loopingly" - I'm sorry that I cannot describe the term better, so I will describe it with an image. I'd like to have the following behavior: If I do a canvas.fillRect, everything that intersects with the canvas is filled normally; but everything that if "off canvas" will be translated to the opposite side. This effectively means, if I fill a rect that has a right "off canvas" part, this part will be drawn to the left side instead. This, of course, should work for every viable combination of sides, e.g. right bottom. While it should'nt be to hard to implement this behavior on my own - I could just cut the rects apart and make multiple fillRect calls - I'd like to know if there is a way to tell the canvas to do it naturally for the parts that are "off canvas". This is not just about rects, but about images, circles, ... If you look at the picture, the 3rd picture would mean that, if I implemented it on my own by cutting the rect into regions, I would have to perform 4 fillRect calls instead of one. And if it was an image, there would be 4 drawImage calls instead of one (also clearRect calls since I'm working with opacity). Thanks in advance for anyone helping me PS: I just wanted to ask you guys before I attempted to "have it my way" - it may also be the case that I'm suffering from premature optimization
-
Need some help and hoping someone will know an answer. I'm trying to create a tilemap world where if the player continues to walk right, eventually they end up back at the beginning of the stage. Does anyone have any idea how this is accomplished?
-
Hi, I think there is a bug with TileSprite when using a frame of a sprite atlas instead of a single image. When I try to do this, the whole sprite atlas gets repeated instead of the desired frame. So when I do: this.game.add.tileSprite(0, 0, 800, 600, 'generalAtlas','pitchTexture1.png'); I get the whole atlas repeating. I checked that it's not a problem with my atlas by trying the same thing but in a regular Sprite: this.game.add.sprite(0, 0, 'generalAtlas','pitchTexture1.png'); This works fine. Is this a bug? Or am I doing something wrong? Thanks
- 3 replies
-
- TileSprite
- atlas
-
(and 2 more)
Tagged with: