YesNoOk
avatar

How to position a character/helper wherever you want on the screen. (Read 9342 times)

Started by Bane84, September 06, 2005, 08:05:04 am
Share this topic:
How to position a character/helper wherever you want on the screen.
#1  September 06, 2005, 08:05:04 am
  • avatar
  • ***
  • Original characters are my forte.
    • http://network.mugenguild.com/bane84/
While making the Shooter Game, I have come across the need where I need helpers to be at a certain position on the screen at a certain time (in regards to the ScreenPos trigger).

I found this formula pretty useful in getting them where I wanted them to go.

Use this formula with the PosAdd state control:

PosAdd(X) = Desired X Position - ScreenPos X
PosAdd(Y) = Desired Y Position - ScreenPos Y

Example:  Put a helper on the screen at position X=60,Y=100

[State #, PosSet]
type = PosAdd
trigger1 = (whatever)
X = 60-ScreenPos X
Y = 100-ScreenPos Y

You may or may not have a use for this kind of formula, but meh.
Re: How to position a character/helper wherever you want on the screen.
#2  September 08, 2005, 11:10:00 pm
  • avatar
  • ****
  • I stand alone.
    • UK
    • hyperionx.net
Haven't tried it yet, so, say I want to make a custom powerbar, would the same apply? Or a certain character face/icon. So it moves along with you regardless how many times the camera moves? I used an explod for that, or does this apply to a helper only?

EDIT: Because I think I've done something similar but it stuck at that position of the screen without using it. I was wondering if you can do any more indepth as to what this formula is used for? I'm just kinda confused now :sweatdrop:

The more I read it the more I don't understand (the description, not the code). :blank:
Don't PM me. =(
(•_•)

( •_•)>⌐■-■

(⌐■_■)
Last Edit: September 08, 2005, 11:12:04 pm by LadyKiKi
Re: How to position a character/helper wherever you want on the screen.
#3  September 08, 2005, 11:14:46 pm
  • ******
  • Just a butcher on a mission
    • www.justnopoint.com/lbends
His method simplifies the placement of objects on the screen because you can use the screen's actual coordinates.  Using something like say... PosSet, X will be 0 at the center of the screen or centered on the character (depending on the arguments you set) and may cause problems, and the Y axis might be screwy as well.
Re: How to position a character/helper wherever you want on the screen.
#4  September 08, 2005, 11:17:40 pm
  • avatar
  • ***
  • Original characters are my forte.
    • http://network.mugenguild.com/bane84/
His method simplifies the placement of objects on the screen because you can use the screen's actual coordinates.  Using something like say... PosSet, X will be 0 at the center of the screen or centered on the character (depending on the arguments you set) and may cause problems, and the Y axis might be screwy as well.

Exactly.  This applies only to Characters/Helpers because they have Pos X/Y coordinates.  My formula sets these values relative to the on screen values.

For Explods, just stick with ScreenPos X and ScreenPos Y and set their offset to left.