Scrolling an Image and Repeat itself

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Considering how we have Sprites and TilingSprites now, how do you exactly make something move or scroll horizontally or vertically? For ex:

Milena.prototype.letMeScroll = function() { this.tileSprite = new Sprite(); this.tileSprite.bitmap = ImageManager.loadSystem("Grass");}Milena.prototype.scrollMe = function() {//how to scroll tileSprite horz or vertically here?}I want it to work like how Planes work in RMVXAce, where when you scroll the image the image repeats itself, not like a sprite that doesn't.
 
Last edited by a moderator:

 Masked 

Assistant
Veteran
Joined
Oct 28, 2015
Messages
90
Reaction score
261
First Language
Portuguese
Primarily Uses
RMMZ
Use the TilingSprite origin property:

Code:
Milena.prototype.letMeScroll = function() {  this.tileSprite = new TilingSprite();  this.tileSprite.bitmap = ImageManager.loadSystem("Grass");}Milena.prototype.scrollMe = function(x, y) {  this.tileSprite.origin.x += x;  this.tileSprite.origin.y += y;}
 
Last edited by a moderator:

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Hmm, I have just one more problem, may I ask why the sprite doesn't show on the screen when I use TilingSprite? When I use Sprite it shows just fine, but TilingSprite, it doesn't.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top