Пример #1
0
        public override void OnBuilt()
        {
            Button farmButton = new Button(PlayState.GUI, PlayState.GUI.RootComponent, "Farm", PlayState.GUI.DefaultFont,
                                           Button.ButtonMode.ImageButton, new NamedImageFrame(ContentPaths.GUI.icons, 32, 5, 1))
            {
                LocalBounds = new Rectangle(0, 0, 32, 32),
                DrawFrame   = true,
                TextColor   = Color.White,
                DrawOrder   = -100
            };

            farmButton.OnClicked += farmButton_OnClicked;
            GUIObject             = new WorldGUIObject(PlayState.ComponentManager.RootComponent, farmButton)
            {
                IsVisible      = true,
                LocalTransform = Matrix.CreateTranslation(GetBoundingBox().Center())
            };
            base.OnBuilt();
        }
Пример #2
0
        public override void CreateGUIObjects()
        {
            FarmButton = new Button(PlayState.GUI, PlayState.GUI.RootComponent, "Farm", PlayState.GUI.DefaultFont, Button.ButtonMode.ImageButton, new NamedImageFrame(ContentPaths.GUI.icons, 32, 5, 1))
            {
                LocalBounds = new Rectangle(0, 0, 32, 32),
                DrawFrame   = true,
                TextColor   = Color.White,
                ToolTip     = "Click to make selected employees work this " + RoomData.Name,
                DrawOrder   = -100
            };
            FarmButton.OnClicked += farmButton_OnClicked;

            if (GUIObject != null)
            {
                GUIObject.Die();
            }

            GUIObject = new WorldGUIObject(PlayState.ComponentManager.RootComponent, FarmButton)
            {
                IsVisible      = true,
                LocalTransform = Matrix.CreateTranslation(GetBoundingBox().Center())
            };
        }
Пример #3
0
        public override void CreateGUIObjects()
        {
            FarmButton = new Button(PlayState.GUI, PlayState.GUI.RootComponent, "Farm", PlayState.GUI.DefaultFont,
             Button.ButtonMode.ImageButton, new NamedImageFrame(ContentPaths.GUI.icons, 32, 5, 1))
            {
                LocalBounds = new Rectangle(0, 0, 32, 32),
                DrawFrame = true,
                TextColor = Color.White,
                ToolTip = "Click to make selected employees work this " + RoomData.Name,
                DrawOrder = -100
            };
            FarmButton.OnClicked += farmButton_OnClicked;

            if (GUIObject != null)
            {
                GUIObject.Die();
            }

            GUIObject = new WorldGUIObject(PlayState.ComponentManager.RootComponent, FarmButton)
            {
                IsVisible = true,
                LocalTransform = Matrix.CreateTranslation(GetBoundingBox().Center())
            };
        }
Пример #4
0
 public override void OnBuilt()
 {
     Button farmButton = new Button(PlayState.GUI, PlayState.GUI.RootComponent, "Farm", PlayState.GUI.DefaultFont,
         Button.ButtonMode.ImageButton, new NamedImageFrame(ContentPaths.GUI.icons, 32, 5, 1))
     {
         LocalBounds = new Rectangle(0, 0, 32, 32),
         DrawFrame = true,
         TextColor = Color.White,
         DrawOrder = -100
     };
     farmButton.OnClicked += farmButton_OnClicked;
     GUIObject = new WorldGUIObject(PlayState.ComponentManager.RootComponent, farmButton)
     {
         IsVisible = true,
         LocalTransform = Matrix.CreateTranslation(GetBoundingBox().Center())
     };
     base.OnBuilt();
 }