What about relative positioning of textdraws and their multicolor?

Started by EK.IceFlake, Feb 28, 2015, 05:25 AM

Previous topic - Next topic

EK.IceFlake


.

What do you mean with "relative positioning"? Relative to what?
.

EK.IceFlake

Relative to the screen of players, so to can add textdraws in small screen and will not disappear. (And also sprites)

.

Quote from: NE.CrystalBlue on Feb 28, 2015, 05:46 AMRelative to the screen of players, so to can add textdraws in small screen and will not disappear. (And also sprites)

You mean like percentage? This could be done with floating points. 0.0 is the start position and 1.0 would be the maximum position. And on the client they'd have to multiply that by the associated resolution axis to obtain the requested position.

That means when you specify a position of (0.462, 0.764) and you have a resolution of (1024 x 768) then the following would be done on the client:
// Results in 473.088 and will get rounded to 473.
int x_pos = (int)(1024 * 0.462);

// Results in 586.752 and will get rounded to 586.
int y_pos = (int)(768 * 0.764);

That's how this should be implemented to fix this issue. They could also leave the older version for pixel perfect positioning but you get the idea of how relative positioning works on screens :)

Or at least give us a way to get the client resolution on the server and do the math our self's :)
.

DizzasTeR

Well actually this can all be solved if only we get the oppertunity to get the resolution of a player, otherwise as someone suggested me that we have to manually take their resolution by force like we force them to register, thats how we can place things for them according to their resolution.

I hope developers might add that feature in official release.

Sebastian

* sseebbyy is also waiting to see that relative positionating for screen's stuff, and multicolored textdraws. :)

rww

Join to Irrelevant Club Discord: https://discord.gg/MsPPZ5uV4X

AdTec_224

Quote from: Doom_Killer on Feb 28, 2015, 06:11 AMWell actually this can all be solved if only we get the oppertunity to get the resolution of a player, otherwise as someone suggested me that we have to manually take their resolution by force like we force them to register, thats how we can place things for them according to their resolution.

I hope developers might add that feature in official release.

I actually only thought of this the other day, it is indeed something that needs adding.

Quote from: rwwpl on Feb 28, 2015, 09:38 AMLiberty Unleashed also needs this!

Liberty Unleashed already has constants to get the screen width and height ("ScreenWidth" and "ScreenHeight").

rww

Quote from: AdTec_224 on Feb 28, 2015, 09:46 AM
Quote from: Doom_Killer on Feb 28, 2015, 06:11 AMWell actually this can all be solved if only we get the oppertunity to get the resolution of a player, otherwise as someone suggested me that we have to manually take their resolution by force like we force them to register, thats how we can place things for them according to their resolution.

I hope developers might add that feature in official release.

I actually only thought of this the other day, it is indeed something that needs adding.

Quote from: rwwpl on Feb 28, 2015, 09:38 AMLiberty Unleashed also needs this!

Liberty Unleashed already has constants to get the screen width and height ("ScreenWidth" and "ScreenHeight").

I thought about the many colors in a single text in gui.
Join to Irrelevant Club Discord: https://discord.gg/MsPPZ5uV4X

.

Quote from: rwwpl on Feb 28, 2015, 09:51 AMI thought about the many colors in a single text in gui.

Now you're just being rude :P That will definitely take some thinking to implement and the resolution issue is much more important than this.
.

Stormeus

0.4 lacks client-side scripting, so having a function to get a player's resolution would be incredibly inefficient for developers and scripters alike. Tracking changes in resolution is not fun.

I have relative positioning as a work-in-progress, though: textdraws can be created and marked as relatively positioned, with a base resolution of 1280x720. The client will handle position scaling to make sure a textdraw is placed in roughly the same spot it would be on a 1280x720 screen.

Multiple colors in one textdraw would be more of a hurdle since text processing is tied to the console, and not the basic font rendering system currently used for textdraws.