当前位置: 首页>>代码示例>>C#>>正文


C# Skin.Get方法代码示例

本文整理汇总了C#中Skin.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Skin.Get方法的具体用法?C# Skin.Get怎么用?C# Skin.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Skin的用法示例。


在下文中一共展示了Skin.Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Button

 public Button(Skin skin, string styleName)
     : base(skin)
 {
     Initialize();
     Style = skin.Get<ButtonStyle>(styleName);
     Width = PrefWidth;
     Height = PrefHeight;
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:8,代码来源:Button.cs

示例2: ImageButton

 public ImageButton(Skin skin)
     : this(skin.Get<ImageButtonStyle>())
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:ImageButton.cs

示例3: Window

 public Window(string title, Skin skin)
     : this(title, skin.Get<WindowStyle>())
 {
     Skin = skin;
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:5,代码来源:Window.cs

示例4: ScrollPane

 public ScrollPane(Actor widget, Skin skin, string styleName)
     : this(widget, skin.Get<ScrollPaneStyle>(styleName))
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:ScrollPane.cs

示例5: HorizontalGroup

 public HorizontalGroup(Skin skin, string styleName)
     : this(skin.Get<HorizontalGroupStyle>(styleName))
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:HorizontalGroup.cs

示例6: Dialog

 public Dialog(string title, Skin skin, string windowStyleName)
     : base(title, skin.Get<WindowStyle>(windowStyleName))
 {
     Skin = skin;
     Initialize();
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:6,代码来源:Dialog.cs

示例7: Label

 public Label(CharSequence text, Skin skin)
     : this(text, skin.Get<LabelStyle>())
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:Label.cs

示例8: List

 public List(object[] items, Skin skin, string styleName)
     : this(items, skin.Get<ListStyle>(styleName))
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:List.cs

示例9: Slider

 public Slider(float min, float max, float stepSize, bool vertical, Skin skin, string styleName)
     : this(min, max, stepSize, vertical, skin.Get<SliderStyle>(styleName))
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:Slider.cs

示例10: ImageTextButton

 public ImageTextButton(string text, Skin skin, string styleName)
     : this(text, skin.Get<ImageTextButtonStyle>(styleName))
 {
     Skin = skin;
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:5,代码来源:ImageTextButton.cs

示例11: Tree

 public Tree(Skin skin, string styleName)
     : this(skin.Get<TreeStyle>(styleName))
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:Tree.cs

示例12: InitializeCore

        protected override void InitializeCore()
        {
            ShowDebug = true;

            //Debugger.Launch();

            _spriteBatch = new GdxSpriteBatch(Context.GraphicsDevice);
            _skin = new Skin(Context.GraphicsDevice, "Data/uiskin.json");
            _texture1 = new TextureContext(Context.GraphicsDevice, "Data/badlogicsmall.jpg", true);
            _texture2 = new TextureContext(Context.GraphicsDevice, "Data/badlogic.jpg", true);

            TextureRegion image = new TextureRegion(_texture1);
            TextureRegion imageFlipped = new TextureRegion(image);
            imageFlipped.Flip(true, true);
            TextureRegion image2 = new TextureRegion(_texture2);
            _stage = new Stage(Context.GraphicsDevice.Viewport.Width, Context.GraphicsDevice.Viewport.Height, true, Context.GraphicsDevice);

            Context.Input.Processor = _stage;

            ImageButtonStyle style = new ImageButtonStyle(_skin.Get<ButtonStyle>()) {
                ImageUp = new TextureRegionDrawable(image),
                ImageDown = new TextureRegionDrawable(imageFlipped),
            };
            ImageButton iconButton = new ImageButton(style);

            Button buttonMulti = new TextButton("Multi\nLine\nToggle", _skin, "toggle") {
                IsToggle = true,
            };
            Button imgButton = new Button(new Image(image), _skin);
            Button imgToggleButton = new Button(new Image(image), _skin, "toggle") {
                IsToggle = true,
            };

            Label myLabel = new Label("This is some text.", _skin);
            myLabel.TextWrapping = true;

            Table t = new Table();
            t.Row();
            t.Add(myLabel);

            t.Layout();

            CheckBox checkbox = new CheckBox("Check me", _skin);
            Slider slider = new Slider(0, 10, 1, false, _skin);
            TextField textField = new TextField("", _skin) {
                MessageText = "Click here!",
            };
            SelectBox dropdown = new SelectBox(selectEntries, _skin);
            Image imageActor = new Image(image2);
            ScrollPane scrollPane = new ScrollPane(imageActor);
            MonoGdx.Scene2D.UI.List list = new MonoGdx.Scene2D.UI.List(listEntries, _skin);
            ScrollPane scrollPane2 = new ScrollPane(list, _skin);
            //scrollPane2.FlickScroll = false;
            SplitPane splitPane = new SplitPane(scrollPane, scrollPane2, false, _skin, "default-horizontal");
            _fpsLabel = new Label("fps:", _skin);

            Label passwordLabel = new Label("Textfield in password mode: ", _skin);
            TextField passwordField = new TextField("", _skin) {
                MessageText = "password",
                PasswordCharacter = '*',
                IsPasswordMode = true,
            };

            Window window = new Window("Dialog", _skin);
            window.SetPosition(0, 0);
            window.Defaults().SpaceBottom = 10;
            window.Row().Configure.Fill().ExpandX();
            window.Add(iconButton);
            window.Add(buttonMulti);
            window.Add(imgButton);
            window.Add(imgToggleButton);
            window.Row();
            window.Add(checkbox);
            window.Add(slider).Configure.MinWidth(100).FillX().Colspan(3);
            window.Row();
            window.Add(dropdown).Configure.MinWidth(100).FillX();
            window.Add(textField).Configure.MinWidth(100).ExpandX().FillX().Colspan(3);
            window.Row();
            window.Add(splitPane).Configure.Fill().Expand().Colspan(4).MaxHeight(200);
            window.Row();
            window.Add(passwordLabel).Configure.Colspan(2);
            window.Add(passwordField).Configure.MinWidth(100).ExpandX().FillX().Colspan(2);

            window.Pack();

            /*textField.KeyUp += (field, c) => {
                if (c == '\n')
                    field.OnscreenKeyboard.Show(false);
            };*/

            _stage.AddActor(window);

            MonoGdx.Scene2D.UI.List list2 = new MonoGdx.Scene2D.UI.List(listEntries, _skin);
            ScrollPane scrollPane22 = new ScrollPane(list2, _skin);
            Window window2 = new Window("ScrollPane", _skin);
            window2.SetPosition(300, 300);
            window2.Defaults().SpaceBottom = 10;
            window2.Row().Configure.Fill().ExpandX();
            window2.Add(scrollPane22).Configure.MaxHeight(250).MaxWidth(150);
            window2.Pack();
//.........这里部分代码省略.........
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:101,代码来源:UITest.cs

示例13: CheckBox

 public CheckBox(string text, Skin skin)
     : this(text, skin.Get<CheckBoxStyle>())
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:CheckBox.cs

示例14: SplitPane

 public SplitPane(Actor firstWidget, Actor secondWidget, bool vertical, Skin skin)
     : this(firstWidget, secondWidget, vertical, skin.Get<SplitPaneStyle>())
 {
 }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:4,代码来源:SplitPane.cs

示例15: InitializeCore

        protected override void InitializeCore()
        {
            //Debugger.Launch();
            _stage = new Stage(Context.Window.ClientBounds.Width, Context.Window.ClientBounds.Height, true, Context.GraphicsDevice);
            Skin skin = new Skin(Context.GraphicsDevice, "Data/uiskin.json");
            Context.Input.Processor = _stage;

            _container = new Table();
            _stage.AddActor(_container);
            _container.SetFillParent(true);

            Table table = new Table();

            ScrollPane scroll = new ScrollPane(table, skin);

            /*InputListener stopTouchDown = new DispatchInputListener() {
                OnTouchDown = (ev, x, y, pointer, button) => {
                    ev.Stop();
                    return false;
                },
            };*/

            table.Pad(10);
            table.Defaults().Configure.ExpandX().Space(4);

            for (int i = 0; i < 100; i++) {
                table.Row();
                Cell rowCell = table.Add(new Label(i + "uno", skin));
                rowCell.ExpandX = 1;
                rowCell.FillX = 1;

                TextButton button = new TextButton(i + "dos", skin);
                table.Add(button);
                button.Clicked += (a, e) => {
                    Console.WriteLine("Clicked");
                };

                Slider slider = new Slider(0, 100, 1, false, skin);
                slider.TouchDown += (s, e) => { e.Stopped = true; };
                table.Add(slider);

                table.Add(new Label(i + "tres long0 long1 long2 long3 long4 long5 long6 long7 long8 long9 long10 long11 long12", skin));
            }

            TextButton flickButton = new TextButton("Flick Scroll", skin.Get<TextButtonStyle>("toggle")) {
                IsToggle = true,
                IsChecked = false,
            };
            flickButton.Checked += (sender, e) => { scroll.FlickScroll = true; };
            flickButton.Unchecked += (sender, e) => { scroll.FlickScroll = false; };

            TextButton fadeButton = new TextButton("Fade Scrollbars", skin.Get<TextButtonStyle>("toggle")) {
                IsToggle = true,
                IsChecked = false,
            };
            fadeButton.Checked += (sender, e) => { scroll.FadeScrollBars = true; };
            fadeButton.Unchecked += (sender, e) => { scroll.FadeScrollBars = false; };

            TextButton smoothButton = new TextButton("Smooth Scrolling", skin.Get<TextButtonStyle>("toggle")) {
                IsToggle = true,
                IsChecked = false,
            };
            smoothButton.Checked += (sender, e) => { scroll.SmoothScrolling = true; };
            smoothButton.Unchecked += (sender, e) => { scroll.SmoothScrolling = false; };

            TextButton onTopButton = new TextButton("Scrollbars On Top", skin.Get<TextButtonStyle>("toggle")) {
                IsToggle = true,
                IsChecked = false,
            };
            onTopButton.Checked += (sender, e) => { scroll.ScrollBarsOnTop = true; };
            onTopButton.Unchecked += (sender, e) => { scroll.ScrollBarsOnTop = false; };

            _container.Add(scroll).Configure.Expand().Fill().Colspan(4);
            _container.Row().Configure.Space(10).PadBottom(10);
            _container.Add(flickButton).Configure.Right().ExpandX();
            _container.Add(onTopButton);
            _container.Add(smoothButton);
            _container.Add(fadeButton).Configure.Left().ExpandX();
        }
开发者ID:jaquadro,项目名称:MonoGdx,代码行数:79,代码来源:ScrollPaneTest.cs


注:本文中的Skin.Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。