Mounting Text Objects - Change Mount Point Behavior Possible?
by Majicpanda · in Torque Game Builder · 07/28/2012 (9:41 am) · 1 replies
When you mount a text object to a sceneObject it mounts it based on the middle of the text object. The issue is if anything moves or the size of the text changes it expands the text object from the center causing your text to not technically be mounted where you would have expected it to be.
This works fine for center aligned text, but if you want to keep text aligned left and have it expand out only to the right this is an issue.
Is there any way to modify the default behavior or this? I assume it would be a c++ modification of sorts, but I'd like to mount a text object and when you select Left from alignment on it, have it grow to the right by default. I'd think this would be a default behavior of a text object based on alignment.
A hack I've done is to detect the size of the textbox in relation to its original size and divide by 2 to make it mimic the behavior of never moving, and then store the mount point of where I wanted it to start and set the text object's position to the mount point. This works ok except there's a tiny stutter effect of the text moving and it's just harder overall to hide everything for instance if it's a tooltip you can't simply set inherit properties so if the tooltip object goes visible=false so do all he mounted objects.. opposed to tracking them all in a simset and hiding them.
Any ideas?
Thanks.
This works fine for center aligned text, but if you want to keep text aligned left and have it expand out only to the right this is an issue.
Is there any way to modify the default behavior or this? I assume it would be a c++ modification of sorts, but I'd like to mount a text object and when you select Left from alignment on it, have it grow to the right by default. I'd think this would be a default behavior of a text object based on alignment.
A hack I've done is to detect the size of the textbox in relation to its original size and divide by 2 to make it mimic the behavior of never moving, and then store the mount point of where I wanted it to start and set the text object's position to the mount point. This works ok except there's a tiny stutter effect of the text moving and it's just harder overall to hide everything for instance if it's a tooltip you can't simply set inherit properties so if the tooltip object goes visible=false so do all he mounted objects.. opposed to tracking them all in a simset and hiding them.
Any ideas?
Thanks.
Majicpanda
Vigilant Addiction Studios
I think this will still create future problems when the sprite GUI resizes itself based on resolutions, but that will have to be discovered upon testing later on if we allow res changes I guess.