Beispiel #1
0
        public Widget makeFuncButton(string txt, Action func)
        {
            ClickTextWidget clickText = new ClickTextWidget(new Vector2(50, 40), txt, func, true);

            clickText.Margin = new Vector2(5, 2);
            clickText.labelWidget.FontScale = 1f;
            clickText.labelWidget.Color     = Color.Black;
            return(clickText);
        }
Beispiel #2
0
        public Widget makeButton(string txt, Action tas)
        {
            ClickTextWidget clickTextWidget = new ClickTextWidget(new Vector2(120, 30), txt, tas);

            clickTextWidget.rectangleWidget.OutlineColor = Color.White;
            clickTextWidget.BackGround = Color.Gray;
            clickTextWidget.rectangleWidget.OutlineThickness = 2;
            clickTextWidget.Margin = new Vector2(0, 3);
            clickTextWidget.labelWidget.FontScale = 0.7f;
            clickTextWidget.labelWidget.Color     = Color.Green;
            return(clickTextWidget);
        }
Beispiel #3
0
        public Widget initData()
        {
            StackPanelWidget stack = new StackPanelWidget()
            {
                Direction = LayoutDirection.Vertical, VerticalAlignment = WidgetAlignment.Center, HorizontalAlignment = WidgetAlignment.Far, Margin = new Vector2(10, 0)
            };

            for (int i = 0; i < 17; i++)
            {
                StackPanelWidget line = new StackPanelWidget()
                {
                    Direction = LayoutDirection.Horizontal
                };
                for (int j = 0; j < 17; j++)
                {
                    int addr = (i - 1) * 16 + (j - 1);
                    if (j > 0 && i > 0)
                    {
                        ClickTextWidget clickTextWidget = new ClickTextWidget(new Vector2(22), string.Format("{0}", MemoryBankData.m_hexChars[Read(addr)]), delegate() {
                            AudioManager.PlaySound("Audio/UI/ButtonClick", 1f, 0f, 0f);
                            clickpos = addr;
                            isclick  = true;
                        });
                        list.Add(clickTextWidget);
                        line.Children.Add(clickTextWidget);
                    }
                    else
                    {
                        int p = 0;
                        if (i == 0 && j > 0)
                        {
                            p = j - 1;
                        }
                        else if (j == 0 && i > 0)
                        {
                            p = i - 1;
                        }
                        else
                        {
                            ClickTextWidget click = new ClickTextWidget(new Vector2(22), "", null);
                            line.Children.Add(click);
                            continue;
                        };
                        ClickTextWidget clickTextWidget = new ClickTextWidget(new Vector2(22), MemoryBankData.m_hexChars[p].ToString(), delegate() {
                        });
                        clickTextWidget.labelWidget.Color = Color.DarkGray;
                        line.Children.Add(clickTextWidget);
                    }
                }
                stack.Children.Add(line);
            }
            return(stack);
        }