コード例 #1
0
ファイル: SpriteDrawCommand.cs プロジェクト: scorvi/dwarfcorp
 public SpriteDrawCommand(Vector3 worldPosition, ImageFrame image)
     : base()
 {
     WorldPosition = worldPosition;
     Image = image;
     Tint = Color.White;
 }
コード例 #2
0
ファイル: IndicatorManager.cs プロジェクト: scorvi/dwarfcorp
        public override void Update(DwarfTime time)
        {
            base.Update(time);
            Animation.Update(time);

            Image = new ImageFrame(Animation.SpriteSheet.GetTexture(), Animation.GetCurrentFrameRect());
        }
コード例 #3
0
ファイル: PlaceBlockSpell.cs プロジェクト: scorvi/dwarfcorp
 public PlaceBlockSpell(string voxelType, bool transmute)
 {
     Texture2D icons = TextureManager.GetTexture(ContentPaths.GUI.icons);
     Image = new ImageFrame(icons, 32, 1, 2);
     VoxelType = voxelType;
     Transmute = transmute;
     if (!transmute)
     {
         Name = VoxelType + " Wall";
         Description = "Create a wall of " + VoxelType;
         Hint = "Click and drag to place " + VoxelType;
         Recharges = false;
         RechargeTimer = new Timer(5.0f, false);
         ManaCost = 15;
         Mode = SpellMode.SelectEmptyVoxels;
     }
     else
     {
         Name = "Transmute " + VoxelType;
         Description = "Transmute any block into " + VoxelType;
         Hint = "Click and drag to transmute.";
         Recharges = false;
         RechargeTimer = new Timer(5.0f, false);
         ManaCost = 25;
         Mode = SpellMode.SelectFilledVoxels;
     }
 }
コード例 #4
0
ファイル: InspectSpell.cs プロジェクト: scorvi/dwarfcorp
 public InspectSpell(InspectType type)
 {
     Type = type;
     Texture2D icons = TextureManager.GetTexture(ContentPaths.GUI.icons);
     Recharges = false;
     switch (type)
     {
         case InspectType.InspectBlock:
         {
             Image = new ImageFrame(icons, 32, 7, 1);
             ManaCost = 0;
             Mode = Spell.SpellMode.SelectFilledVoxels;
             Name = "Inspect Blocks";
             Description = "Mouse over a block to get info about it";
             Hint = "Mouse over a block for info";
             RechargeTimer = new Timer(0.1f, true);
             break;
         }
         case InspectType.InspectEntity:
         {
             Image = new ImageFrame(icons, 32, 7, 1);
             ManaCost = 0;
             Mode = Spell.SpellMode.Continuous;
             Name = "Inspect Objects";
             Description = "Select an entity to get info about it";
             Hint = "Mouse over entities for info";
             RechargeTimer = new Timer(0.1f, true);
             break;
         }
     }
 }
コード例 #5
0
ファイル: CreateEntitySpell.cs プロジェクト: scorvi/dwarfcorp
 public CreateEntitySpell(string entity, bool transmute)
 {
     Entity = entity;
     Transmute = transmute;
     ManaCost = 50;
     Mode = transmute ? SpellMode.SelectEntities : SpellMode.SelectEmptyVoxels;
     Image = new ImageFrame(TextureManager.GetTexture(ContentPaths.GUI.icons), 32, 4, 2);
 }
コード例 #6
0
ファイル: ImagePanel.cs プロジェクト: scorvi/dwarfcorp
 public ImagePanel(DwarfGUI gui, GUIComponent parent, ImageFrame image)
     : base(gui, parent)
 {
     AssetName = "";
     Lock = new Mutex();
     Image = image;
     KeepAspectRatio = true;
 }
コード例 #7
0
ファイル: MinimapIcon.cs プロジェクト: scorvi/dwarfcorp
 public MinimapIcon(Body parent, ImageFrame icon)
     : base("Icon", parent, Matrix.Identity, Vector3.One, Vector3.Zero)
 {
     Icon = icon;
     IconScale = 1.0f;
     AddToCollisionManager = false;
     FrustrumCull = false;
     IsVisible = false;
 }
コード例 #8
0
ファイル: GItem.cs プロジェクト: scorvi/dwarfcorp
 public GItem(string name, ImageFrame imag, int min, int max, int currentAmount, float price)
 {
     Name = name;
     Image = imag;
     MinAmount = min;
     MaxAmount = max;
     CurrentAmount = currentAmount;
     Price = price;
 }
コード例 #9
0
ファイル: RoomData.cs プロジェクト: scorvi/dwarfcorp
 public RoomData(string name, uint id, string floorTexture, Dictionary<ResourceLibrary.ResourceType, ResourceAmount> requiredResources, List<RoomTemplate> templates, ImageFrame icon)
 {
     Name = name;
     ID = id;
     FloorType = floorTexture;
     RequiredResources = requiredResources;
     Templates = templates;
     Icon = icon;
     Description = "";
 }
コード例 #10
0
ファイル: DestroyBlockSpell.cs プロジェクト: scorvi/dwarfcorp
 public DestroyBlockSpell()
 {
     Texture2D icons = TextureManager.GetTexture(ContentPaths.GUI.icons);
     Description = "Magically destroys up to 8 stone, dirt, or other blocks.";
     Image = new ImageFrame(icons, 32, 2, 2);
     ManaCost = 10;
     Mode = Spell.SpellMode.SelectFilledVoxels;
     Name = "Destroy Blocks";
     Hint = "Click and drag to destroy blocks";
     Recharges = false;
 }
コード例 #11
0
ファイル: ImagePanel.cs プロジェクト: scorvi/dwarfcorp
 public ImagePanel(DwarfGUI gui, GUIComponent parent, Texture2D image)
     : base(gui, parent)
 {
     AssetName = "";
     Highlight = false;
     Lock = new Mutex();
     ConstrainSize = false;
     if(image != null)
     {
         Image = new ImageFrame(image, new Rectangle(0, 0, image.Width, image.Height));
     }
     KeepAspectRatio = true;
 }
コード例 #12
0
ファイル: Button.cs プロジェクト: scorvi/dwarfcorp
 public Button(DwarfGUI gui, GUIComponent parent, string text, SpriteFont textFont, ButtonMode mode, ImageFrame image)
     : base(gui, parent)
 {
     DrawFrame = false;
     Text = text;
     Image = image;
     TextColor = gui.DefaultTextColor;
     HoverTextColor = Color.DarkRed;
     HoverTint = new Color(200, 200, 180);
     PressedTextColor = Color.Red;
     PressedTint = new Color(100, 100, 180);
     ToggleTint = Color.White;
     TextFont = textFont;
     CanToggle = false;
     IsToggled = false;
     OnClicked += Clicked;
     KeepAspectRatio = mode == ButtonMode.ToolButton;
     DontMakeBigger = mode == ButtonMode.ToolButton;
     Mode = mode;
     DontMakeSmaller = false;
     Transparency = 255;
 }
コード例 #13
0
ファイル: IndicatorManager.cs プロジェクト: scorvi/dwarfcorp
 public static void DrawIndicator(ImageFrame image, Vector3 position, float time, float scale, Vector2 offset, Color tint)
 {
     lock(IndicatorLock)
     {
         Indicators.Add(new Indicator
         {
             CurrentTime = new Timer(time, true),
             Image = image,
             Position = position,
             MaxScale = scale,
             Offset = offset,
             Tint = tint
         });
     }
 }
コード例 #14
0
ファイル: Drawer2D.cs プロジェクト: scorvi/dwarfcorp
 public static void DrawSprite(ImageFrame image, Vector3 worldPosition)
 {
     DrawCommands.Enqueue(new SpriteDrawCommand(worldPosition, image));
 }
コード例 #15
0
ファイル: Creature.cs プロジェクト: maroussil/dwarfcorp
        public void DrawIndicator(ImageFrame image)
        {
            if (!((DateTime.Now - LastIndicatorTime).TotalSeconds >= IndicatorRateLimit))
            {
                return;
            }

            IndicatorManager.DrawIndicator(image, AI.Position + new Vector3(0, 0.5f, 0), 1, 1.5f, new Vector2(image.SourceRect.Width / 2.0f, -image.SourceRect.Height / 2.0f));
            LastIndicatorTime = DateTime.Now;
        }
コード例 #16
0
ファイル: Drawer2D.cs プロジェクト: scorvi/dwarfcorp
 public static void DrawSprite(ImageFrame image, Vector3 worldPosition, Vector2 scale, Vector2 offset, Color tint, bool flip = false)
 {
     DrawCommands.Enqueue(new SpriteDrawCommand(worldPosition, image) { Scale = scale, Offset =  offset, Tint = tint, Effects = flip? SpriteEffects.FlipHorizontally : SpriteEffects.None});
 }
コード例 #17
0
 public AnimatedImagePanel(DwarfGUI gui, GUIComponent parent, ImageFrame image)
     : base(gui, parent, image)
 {
 }
コード例 #18
0
 public static void DrawIndicator(ImageFrame image, Vector3 position, float time, float scale, Vector2 offset)
 {
     DrawIndicator(image, position, time, scale, offset, Color.White);
 }
コード例 #19
0
ファイル: IndicatorManager.cs プロジェクト: scorvi/dwarfcorp
 public static void DrawIndicator(ImageFrame image, Vector3 position, float time, float scale, Vector2 offset)
 {
     DrawIndicator(image, position, time, scale, offset, Color.White);
 }