Main Menu
  • Welcome to The RPG Maker Resource Kit.

[RESOLVED] Picture Location Limitations

Started by Yawgmothsbud, June 01, 2007, 04:31:27 AM

0 Members and 1 Guest are viewing this topic.

Yawgmothsbud

The title is kind of a fancy way of explaining my problem. More simply, I'm trying to add a picture that consists of a circular gradient and creates a "torch" effect, giving the player only a small window of the map.
The problem is that it only stays centered on your sprite as long as you stay away from the edges of the map: as soon as you the edge of your screen touches the edge of the map, the picture stops moving in that direction, and you move out of the circle of "light".

I've been working on this problem with events for awhile now, and I'm getting nowhere. Any ideas?

modern algebra

You'll need to do a little bit of frigging around to determine the right setting, but if you base picture location on variables then it will work. Specifically, set the variables to the player's screen x and screen y. You will need to subtract a bit from those variables in order to center the picture on the player, but once you figure that out (prolly subtract half the width of the picture from the x and half the height of the picture from the y), you'll be golden.

Zeriab

It would be easier if you just increased the map size and put some impassable stuff around the edges so the player will always stay dead center.

modern algebra

That kind of sounds much more annoying <3. I think my way works well. If you put it on center it works even better.

Yawgmothsbud

Centering it is actually the easy part. You're right, Algebra, I had been using the players X and Y coordinates to determine the picture location. However, this stops working when you approach the edge of the map. So far, Zeriab's solution is all I had been able to think of, and I was hoping there was a better way.

modern algebra

#5
Don't use Map X and Map Y. Use Screen X and Screen Y

EDIT:
Like this demo:


Yawgmothsbud

Thanks Modern Algebra. Once again you have saved me from endless frustration :D