You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and the at contains a rectangle, (left, top, width, height) in which the text shall be aligned according to align.
We can calculate this by hand with a string compare like if (string_contains(align, "fa_middle")) at[1] += at[3] / 2 but this is ugly code.
It would be great, if the scribble object allows to define a virtual sheet which it will consider when rendering text.
Now, when I render text at some position x/y, this is the top left corner where the sheet "starts" and from that origin point, the text will be aligned as if its bbox would be my_width/my_height in dimensions.
I could also imagine, that the sheet function takes 4 arguments, left.top.width.height and the left and top would be an additional offset to the x/y i send to draw.
Any of these solutions is fine!
I hope, I could explain, what I mean
cheers,
Gris
The text was updated successfully, but these errors were encountered:
JujuAdams
changed the title
Feature: "Virtual Sheet" support - Set a render area dimension for scribble elements
"Virtual Sheet" support - Set a render area dimension for scribble elements
Oct 23, 2024
et voilá! Your entire sprite is the virtual area and you can align text in any corner or the center of your object, no matter where the origin of the sprite is located, by simply calling
.draw(x,y) where x and y are also the green variables, the coordinates of the object.
Maybe even a 5th argument?
a fifth argument could be a bool, auto_wrap to keep the text within the dimensions of the area. Or would you say, using a sheet will always auto-wrap? Would be very ok also.
Hey Juju,
as discussed on discord, a feature to define an area, a virtual rectangle or "sheet" if you like, where text shall be aligned.
I receive this specification through a json file:
and the
at
contains a rectangle, (left, top, width, height) in which the text shall be aligned according toalign
.We can calculate this by hand with a string compare like
if (string_contains(align, "fa_middle")) at[1] += at[3] / 2
but this is ugly code.It would be great, if the scribble object allows to define a virtual sheet which it will consider when rendering text.
Could look like this:
Now, when I render text at some position x/y, this is the top left corner where the sheet "starts" and from that origin point, the text will be aligned as if its bbox would be my_width/my_height in dimensions.
I could also imagine, that the
sheet
function takes 4 arguments, left.top.width.height and the left and top would be an additional offset to the x/y i send todraw
.Any of these solutions is fine!
I hope, I could explain, what I mean
cheers,
Gris
The text was updated successfully, but these errors were encountered: