コード例 #1
0
ファイル: WheatFarm.cs プロジェクト: chrisapril/dwarfcorp
        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
ファイル: Farm.cs プロジェクト: scorvi/dwarfcorp
        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
ファイル: WheatFarm.cs プロジェクト: scorvi/dwarfcorp
 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();
 }