SC2Mapster Forums

Development > Galaxy Scripting

Portion of texture for image?

  • 5 posts
    #1 Oct 29, 2012 at 23:03 UTC - 0 likes

    Is there any function to draw/use only a specified region of an image as a button's image or something like that? Instead of always using the entire image and then scaling it by default?

    I am new to the SC2 Editor, but I have years of C programming experience (relevant to galaxy script).
    Send me a message if you need help with programming concepts or galaxy script syntax.
    Do not ask me how to do something specifically related to SC2 as I am not fluent with the galaxy API yet.

    #2 Oct 30, 2012 at 00:19 UTC - 0 likes

    @soulzek: Go

    you can always export the texture and trim it...


    I have the same question myself but doing it with image items as well.

    How do you use those sprite sheets with the different emblems and stuffs

    Last edited Oct 30, 2012 by SouLCarveRR

    Skype
    KageNinpo = SN

    My Libraries
    DialogLeaderboard & TeamSort

    My Projects
    SPACEWAR Tribute
    Infinite TD

    #3 Oct 30, 2012 at 10:08 UTC - 0 likes

    @SouLCarveRR: Go

    Unfortunately this method is not possible for something like a custom progress bar. Would need variable regional image drawing.

    #4 Oct 31, 2012 at 04:41 UTC - 0 likes

    The easiest way to cut off a dialog item (such as an image) is to create it in a panel. You need to create a dialog item of type panel in a dialog, then create a dialog item (your image) inside that panel with Create Dialog Item in Panel. Dialog items within a panel will only show the portion of it thats actually within the panel.

    #5 Nov 13, 2012 at 14:51 UTC - 0 likes

    Or you can just set tile to false. Depending on the anchor it will cut off the rest.

  • 5 posts

You must login to post a comment. Don't have an account? Register to get one!