public SpriteDrawCommand(Vector3 worldPosition, ImageFrame image) : base() { WorldPosition = worldPosition; Image = image; Tint = Color.White; }
public override void Update(DwarfTime time) { base.Update(time); Animation.Update(time); Image = new ImageFrame(Animation.SpriteSheet.GetTexture(), Animation.GetCurrentFrameRect()); }
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; } }
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; } } }
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); }
public ImagePanel(DwarfGUI gui, GUIComponent parent, ImageFrame image) : base(gui, parent) { AssetName = ""; Lock = new Mutex(); Image = image; KeepAspectRatio = true; }
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; }
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; }
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 = ""; }
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; }
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; }
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; }
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 }); } }
public static void DrawSprite(ImageFrame image, Vector3 worldPosition) { DrawCommands.Enqueue(new SpriteDrawCommand(worldPosition, image)); }
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; }
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}); }
public AnimatedImagePanel(DwarfGUI gui, GUIComponent parent, ImageFrame image) : base(gui, parent, image) { }
public static void DrawIndicator(ImageFrame image, Vector3 position, float time, float scale, Vector2 offset) { DrawIndicator(image, position, time, scale, offset, Color.White); }