Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Importing labels #170

Open
al0fdf opened this issue Jul 17, 2023 · 0 comments
Open

Feature request: Importing labels #170

al0fdf opened this issue Jul 17, 2023 · 0 comments

Comments

@al0fdf
Copy link

al0fdf commented Jul 17, 2023

Would be nice to be able to import labels.
A few notes regarding the implementation of this:

  • Get the <text> tag under the object:
    <object id="129" x="208" y="768" width="57.3707" height="17.7732">
       <text pixelsize="12">TUTORIAL_JUMP</text>
    </object>
    
  • Store x, y, width, height
  • Compute label rect position and rect size from x,y,w,h
  • For setting font color of a label:
    label.set("custom_colors/font_color", Color.black)
  • For halign and valign:
    {
        "center": Label.ALIGN_CENTER,
        "right": Label.ALIGN_RIGHT,
        "justify": Label.ALIGN_FILL,
        "left": Label.ALIGN_LEFT,
    }
    
    {
        "center": Label.VALIGN_CENTER,
        "bottom": Label.VALIGN_BOTTOM,
        "top": Label.VALIGN_TOP,
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant