Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Using a seamless, looping background  (Read 3441 times)

0 Members and 1 Guest are viewing this topic.

Ryouko

  • Clumpsy, tea loving artist~
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 23
  • Uhm... nothing to say here! =D
    • View Profile
Using a seamless, looping background
« on: December 18, 2011, 05:13:13 PM »

Hi there! =)

I'm coming straight from the RPG-Maker XP, and as much I love WME with it's functions, I really miss the fog function the RMXP had.
It works like this:
You have an image (for example a pattern of the size 100x100) and set the x&y-movement.
The image kinda wraps itself around it's edges (uuh... kinda having troubles explaining that...), so that the screen is filled with the image.
Basicly, it's like this:
http://www.youtube.com/watch?v=lGGctC2YAyU&feature=results_main&playnext=1&list=PLEC5593CAC8972729
(The green, moving stuff at the bottom screen.)
You have only this singe picture (the green pattern) but the screen is still filled with it.
I plan on using it for backgrounds (similar to the video), clouds, fogs etc.

If somebody could explain me how to make something like this with scripting or any other way you'd really make my day! ♥

Please tell me if my explanation was unclear so that I can try to be more precise. =o

- Ryouko
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Using a seamless, looping background
« Reply #1 on: December 18, 2011, 08:46:31 PM »

Well basically you'd need to create several "tiles" with the same image, move them around, and once one tile goes off screen, you'd move it to the other edge of the screen so that it scrolls in again. That way the tiles get "recycled" all the time. I'm pretty sure that's what RMXP is doing behind the scenes.

In WME terms the tiles would be sprite entities, and the script would simply change the entities' X and Y positions in a loop.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Ryouko

  • Clumpsy, tea loving artist~
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 23
  • Uhm... nothing to say here! =D
    • View Profile
Re: Using a seamless, looping background
« Reply #2 on: December 18, 2011, 09:01:20 PM »

Hmmmm... I thought so.
Thank you for answering! :>
Would you mind helping me with the script?
I'm new at WME and fail at scripting, so getting the hang of it is kinda hard for me.
I'd just need an example to understand it, I guess~
So, after creating a sprite entitie I'll make a script for it, right?
Inside needs to be a loop which changes the x-position (I'll leave out the y-position here since I don't need it in this case), until it reaches a specific x-position (the boarder of the screen). Then it changes the x-position back (for example to 0) and it's looping again since the unless-case isn't fulfilled.
But how do you change the position?
The wiki says x - does this need to be in this "on event", or just without?
Is it name.x = +1 or...?

Uhm... Thank you in advance! v_v
You're making prettier backgrounds possible. x3

- Ryouko

--- x3

Edit:

Okay, I found a thread with the solution!
Thank you for the help! =)
It really made my day! <3
« Last Edit: December 18, 2011, 09:36:30 PM by Ryouko »
Logged

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Using a seamless, looping background
« Reply #3 on: December 20, 2011, 10:13:02 AM »

Hey, what was the thread you found with the solution?
Logged

Ryouko

  • Clumpsy, tea loving artist~
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 23
  • Uhm... nothing to say here! =D
    • View Profile
Re: Using a seamless, looping background
« Reply #4 on: December 20, 2011, 04:57:59 PM »

Ah, sorry for not posting it, I'll remember to do it next time!
Here it is (near the bottom):
http://forum.dead-code.org/index.php?topic=4419.0
For the looping backgrounds, I use my pattern (that is screensize) twice as big and set it back to the startpoint once it ran through once (screensize).
And with sleep you can control the veloncity~
Have fun. :>

- Ryouko
Logged
 

Page created in 0.017 seconds with 21 queries.