GUI Stacked Widget not working

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Glen
Posts: 78
Joined: August 20th, 2011, 10:59 pm

GUI Stacked Widget not working

Post by Glen »

Hi, I'm attemping to make a GUI for my scenario in WML.
Its a GUI for 4 players to place bets. In the center I'm attempting to place a poker board with a circle image and overlay it with a label in the center that displays the pot amount using a [stacked_widget]

The rest of the GUI currently displays except the stacked_widget. I think I did something wrong with the stacked_widget but I don't know what. I'll post the relevant code with the stacked_widget and the full gui below it.

Image

STACKED WIDGET

Code: Select all

	        # CENTER TABLE
      [column]
            [grid]
                    [row]
                        [column]
                          [stacked_widget]
                            definition="default"
                            selected_index = 0
                              [layer]
                                [image]
                                    label = "scenery/circle-magic.png~SCALE(300,300)"
                                    tooltip = _ "Poker Table"
                                [/image]
                              [/layer]

                              [layer]
                                [label]
                                    id = "pot_label"
                                    label = "30"
                                    definition = "title"
                                [/label]
                              [/layer]
                          [/stacked_widget]
                        [/column]
                    [/row]
                [/grid]
          [/column]
FULL GUI

Code: Select all

[resolution]
    definition = "poker_table"
    vertical_placement = "center"
    horizontal_placement = "center"
    maximum_width = 800
    maximum_height = 700

    [helptip]
        id = "tooltip_large"
    [/helptip]
    [tooltip]
        id = "tooltip_large"
    [/tooltip]

    [grid]
        # Row 1: North
        [row]
            [column]
                [spacer][/spacer]
            [/column]
            [column]
                [grid]
                    [row]
                        [column]
                            [grid]
                                [row]
                                    [column]
                                        [image]
                                            label = "units/human-loyalists/fencer.png~CROP(16,16,64,64)~SCALE(80,80)"
                                        [/image]
                                    [/column]
                                    [column]
                                        [label]
                                            id = "player_north"
                                            definition = "player_name_small_italic"
                                        [/label]
                                    [/column]
                                [/row]
                            [/grid]
                        [/column]
                    [/row]
                    [row]
                        [column]
                            [spacer]
                                height = 10
                            [/spacer]
                        [/column]
                    [/row]
                    [row]
                        [column]
                            horizontal_alignment = "center"
                            [label]
                                id = "bet_north"
                                label = "50"
                                definition = "title"
                            [/label]
                        [/column]
                    [/row]
                [/grid]
            [/column]
            [column]
                [spacer][/spacer]
            [/column]
        [/row]

        # Row 2: West - Center - East
        [row]
            # WEST
            [column]
                [grid]
                    [row]
                        [column]
                            [image]
                                label = "units/orcs/grunt.png~CROP(16,16,64,64)~SCALE(80,80)"
                            [/image]
                        [/column]
                        [column]
                            [label]
                                id = "player_west"
                                definition = "player_name_small_italic"
                            [/label]
                        [/column]
                        [column]
                            [spacer]
                                width = 20
                            [/spacer]
                        [/column]
                        [column]
                            [label]
                                id = "bet_west"
                                label = "100"
                                definition = "title"
                            [/label]
                        [/column]
                    [/row]
                [/grid]
            [/column]

            # CENTER TABLE
      [column]
            [grid]
                    [row]
                        [column]
                          [stacked_widget]
                            definition="default"
                            selected_index = 0
                              [layer]
                                [image]
                                    label = "scenery/circle-magic.png~SCALE(300,300)"
                                    tooltip = _ "Poker Table"
                                [/image]
                              [/layer]

                              [layer]
                                [label]
                                    id = "pot_label"
                                    label = "30"
                                    definition = "title"
                                [/label]
                              [/layer]
                          [/stacked_widget]
                        [/column]
                    [/row]
                [/grid]
          [/column]
            # EAST


            [column]
                [grid]
                    [row]
                        [column]
                            [label]
                                id = "bet_east"
                                label = "30"
                                definition = "title"
                            [/label]
                        [/column]
                        [column]
                            [spacer]
                                width = 20
                            [/spacer]
                        [/column]
                        [column]
                            [label]
                                id = "player_east"
                                definition = "player_name_small_italic"
                            [/label]
                        [/column]
                        [column]
                            [image]
                                label = "units/elves-wood/archer.png~CROP(16,16,64,64)~SCALE(80,80)"
                            [/image]
                        [/column]
                    [/row]
                [/grid]
            [/column]
        [/row]

        # Row 3: South
        [row]
            [column]
                [spacer][/spacer]
            [/column]
            [column]
                [grid]
                    [row]
                        [column]
                            horizontal_alignment = "center"
                            [label]
                                id = "bet_south"
                                label = "40"
                                definition = "title"
                            [/label]
                        [/column]
                    [/row]
                    [row]
                        [column]
                            [spacer]
                                height = 10
                            [/spacer]
                        [/column]
                    [/row]
                    [row]
                        [column]
                            [grid]
                                [row]
                                    [column]
                                        [image]
                                            label = "units/human-magi/mage.png~CROP(16,16,64,64)~SCALE(80,80)"
                                        [/image]
                                    [/column]
                                    [column]
                                        [label]
                                            id = "player_south"
                                            definition = "player_name_small_italic"
                                        [/label]
                                    [/column]
                                [/row]
                            [/grid]
                        [/column]
                    [/row]
                [/grid]
            [/column]
            [column]
                [spacer][/spacer]
            [/column]
        [/row]
    [/grid]
[/resolution]
User avatar
Celtic_Minstrel
Developer
Posts: 2376
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: GUI Stacked Widget not working

Post by Celtic_Minstrel »

I don't think this is likely to be the issue, but… I suspect you don't need selected_index = 0.

Aside from that, I don't see anything that looks wrong in your [stacked_widget] tag.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
Post Reply