Home › Forums › Problems and solutions in GDL › Documentation elements, text handling › Reposition-able text
- This topic has 4 replies, 3 voices, and was last updated 8 years, 4 months ago by
Dominika Bobály.
-
AuthorPosts
-
-
December 13, 2016 at 01:47 #2917
Patrick May
ParticipantThis is a stupidly rudimentary problem, that I should be able to figure out, but am running into too many road blocks to decipher the GDL help center’s guides.
How do I associate a text box with a hot spot, or other means of graphically repositioning the text?
I want to be able to just click on the text’s mid-point and drag to position. -
December 13, 2016 at 03:33 #2918
Barry Kelly
ParticipantWithout actually writing the code all you need to do is create the script for the moveable (stretchy) hotspot – you can ad a rotating hotspot too if you want.
Then use an ADD2 command (and ROT2 command if desired) using the hotspot parameters.
Then TEXT2 0,0,”text” and the text will move with the hotspots.If you are not worried about moving the text differently for different scales and/or rotating then you can skip the ADD2 and ROT2 and use the hotspot parameters directly in the TEXT2 command.
If you need an actual coded example let me know.
Barry.
Versions 6.5 to 22
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit -
December 13, 2016 at 19:59 #2920
Patrick May
ParticipantI have:
unID = 001
HOTSPOT2 textOffset_x,textOffset_y,001
TEXT2 textOffset_x,textOffset_y,txtParamwhat am I missing? An example would be great…
-
December 14, 2016 at 13:02 #2927
Dominika Bobály
KeymasterBarry is right, you need the “editable” kind of hotspots for parametric positioning. See a tutorial here.
Dominika Bobály
Product Manager
GRAPHISOFT SE
-
-
December 14, 2016 at 03:57 #2922
Barry Kelly
ParticipantYou are using just a single hotspot.
You need a moveable or stretchy hotspot.
In fact you need 2 – one to move horizontally and the other vertically.Something like this…
unID = 1000 !!!!!!!!!!!! x-axis stretchable HOTSPOT2 0, textOffset_y, unID, textOffset_x, 1+256 unID=unID+1 HOTSPOT2 -0.001, textOffset_y, unID, textOffset_x, 3+128 unID=unID+1 HOTSPOT2 textOffset_x, textOffset_y, unID, textOffset_x, 2 unID=unID+1 !!!!!!!!!!!! y-axis stretchable HOTSPOT2 textOffset_x, 0, unID, textOffset_y, 1+256 unID=unID+1 HOTSPOT2 textOffset_x, -0.001, unID, textOffset_y, 3+128 unID=unID+1 HOTSPOT2 textOffset_x, textOffset_y, unID, textOffset_y, 2 unID=unID+1 !!!!!!!!!!the text TEXT2 textOffset_x,textOffset_y,txtParam
The initial UNID can be set to whatever value you want.
The trick is hotspots should always have different values so if you repeat the hotspots again reset with a new UNIDBarry.
Versions 6.5 to 22
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision M6800 - i7 4700MQ @ 2.40GHz, 16GB RAM, AMD FirePro M6100 (2GB), Windows 7 64bit
-
-
AuthorPosts
- The forum ‘Documentation elements, text handling’ is closed to new topics and replies.