Can't make custom tools from Text objects?

pegasusroe shared this question 3 years ago
Answered

In some cases, we have to control the exact positions (and angles) at where text objects should be, so we need some custom tools that have text objects as their dependent parameters to ease the whole process, but every and each custom tool I have made from texts have proved to be useless.


GeoGebra DO allow us to make custom tools from texts, but they only produce "undefined" objects, which makes them useless. Any ideas?

Comments (7)

photo
1

Could you please post a .ggb file before creating the tool and let us know which objects you would like as input/output?

photo
1

This is an important feature to me that I would love to see implemented. I am trying to create a circle with text in it. "Caption" or "Label" won't do because I want a different color. This is why I want to attach Text to the circle. The resulting tool, however, does not include the text as an output.


I've included a sample file.


Any thoughts?

photo
1

see here

another possibility is use laTex in the caption (start and end with $)

photo
photo
1

Hello Zbynek,

let's have a point A, an angle α and the text "Hello".

Which command is necessary to show "Hello" at position A rotated with angle α?

photo
1

Dear Zbyněk,


Here is my sample file: https://www.geogebra.org/m/v9BsRZZj


In this file, there is a red text object (in case you can't see it, move the orange vector, then it will show up, bugs perhaps?), its position and rotation angle are controlled by some factors such as the two black text objects, the orange vector, the padding slider, etc.


Can you turn that red text object into a single custom tool without having to calculate the widths and heights of the original black text and the rotated black text every time?

photo
1

Normaly constants are input-parameter for a custom-tool (Example: Radius of a circle).

The custom-tool decides himself what can be a input-parameter. One (?) of the rules is: has no dependencies.

Normaly a text (example: "100" or "Hello") has no dependencies. So he is from the view of the customer-tool a input-parameter. In some cases this is not the meaning of the custom-tool developer.

Solution:

Make an artificial dependencies of an (internal) constant to a real input-parameter. But in a why so the constant is not change.

Example (assuming the Point A is a real input-parameter)

- First[("Hello"+A),5] -> give the internal constant "Hello"

- First[("100"+A), 3] -> give the internal constant "100"

- 44 * x(A)^0 -> give the internal constant 44

This internal constants can be used as parameter for dependent objects and/or direct as output-objects

===================================================================

.

BUT !

.

To make a custom-tool for center text is not possible. (for me not really clear why, I think because custom-tools has no instance-variables = no memory for each using. And/Or noNamed objects has no corners and the Name of an created text-object (by custom-tool) is not known in the time of developing )

also pathParmeter are not possible.

photo
1

Rami,


Excellent work! Your suggestion is exactly what I was looking for!


Thank you!

© 2020 International GeoGebra Institute