Ejemplo n.º 1
0
        public MusketSmoke(float xpos, float ypos)
            : base(xpos, ypos)
        {
            this.xscale    = 0.15f + Rando.Float(0.15f);
            this.yscale    = this.xscale;
            this.angle     = Maths.DegToRad(Rando.Float(360f));
            this._fastGrow = 0.6f + Rando.Float(0.3f);
            this._angleInc = Maths.DegToRad(Rando.Float(2f) - 1f);
            this._scaleInc = 1f / 1000f + Rando.Float(1f / 1000f);
            this._fade     = 0.0015f + Rando.Float(1f / 1000f);
            this.move.x    = Rando.Float(0.2f) - 0.1f;
            this.move.y    = Rando.Float(0.2f) - 0.1f;
            GraphicList graphicList = new GraphicList();
            Sprite      graphic1    = new Sprite("smoke");

            graphic1.depth = new Depth(1f);
            graphic1.CenterOrigin();
            graphicList.Add(graphic1);
            Sprite graphic2 = new Sprite("smokeBack");

            graphic2.depth = new Depth(-0.1f);
            graphic2.CenterOrigin();
            graphicList.Add(graphic2);
            this.graphic          = (Sprite)graphicList;
            this.center           = new Vec2(0.0f, 0.0f);
            this.depth            = new Depth(1f);
            this._backgroundSmoke = new Sprite("smokeBack");
        }
Ejemplo n.º 2
0
 public static void FreeGraphic()
 {
     if (Graphics != null)
     {
         Graphics.Dispose();
     }
     Graphics = null;
 }
Ejemplo n.º 3
0
        // ###############################################################################
        // ### M E T H O D S
        // ###############################################################################

        #region Methods

        public static X11Graphic GetGraphic(IntPtr display, TInt screenNumber, X11Graphic.StockIcon stock)
        {
            if (Graphics == null)
            {
                Graphics = new GraphicList();
            }
            return(Graphics.Graphic(display, screenNumber, stock));
        }
Ejemplo n.º 4
0
                bool configGraphic(string key, string value, Configuration.Options options)
                {
                    Graphic graphic = null;

                    switch (value.ToLower())
                    {
                    case "text":
                        graphic = new GraphicText(container_, options);
                        break;

                    case "battery":
                        graphic = new GraphicBattery(container_, options);
                        break;

                    case "list":
                        graphic = new GraphicList(container_, options);
                        break;

                    case "bar":
                        graphic = new GraphicBar(container_, options);
                        break;

                    case "icon":
                        graphic = new GraphicIcon(container_, options);
                        break;

                    case "slider":
                        graphic = new GraphicSlider(container_, options);
                        break;

                    case "test":
                        graphic = new GraphicTest(container_, options);
                        break;

                    case "curvedbar":
                        graphic = new GraphicCurvedBar(container_, options);
                        break;
                    }

                    if (graphic != null)
                    {
                        if (graphic.construct())
                        {
                            setSubHandler(graphic.getConfigHandler());
                            container_.graphics_.Add(graphic);
                            return(true);
                        }
                        else
                        {
                            container_.log(Console.LogType.Error, $"Failed to construct graphic:{value}");
                        }
                    }
                    else
                    {
                        container_.log(Console.LogType.Error, $"Invalid graphic type:{value}");
                    }
                    return(false);
                }
Ejemplo n.º 5
0
        public EnemySpawn(float xpos = 0.0f, float ypos = 0.0f)
            : base(xpos, ypos)
        {
            GraphicList graphicList = new GraphicList();
            SpriteMap   spriteMap   = new SpriteMap("duck", 32, 32);

            spriteMap.depth    = new Depth(0.9f);
            spriteMap.position = new Vec2(-8f, -18f);
            graphicList.Add((Sprite)spriteMap);
            this._spawnSprite       = new SpriteMap("spawnSheet", 16, 16);
            this._spawnSprite.depth = new Depth(0.95f);
            graphicList.Add((Sprite)this._spawnSprite);
            this.graphic         = (Sprite)graphicList;
            this._editorName     = "enemy spawn";
            this.center          = new Vec2(8f, 8f);
            this.collisionSize   = new Vec2(16f, 16f);
            this.collisionOffset = new Vec2(-8f, -8f);
        }
Ejemplo n.º 6
0
        public TeamSpawn(float xpos = 0.0f, float ypos = 0.0f)
            : base(xpos, ypos)
        {
            GraphicList graphicList = new GraphicList();

            for (int index = 0; index < 3; ++index)
            {
                SpriteMap spriteMap = new SpriteMap("duck", 32, 32);
                spriteMap.CenterOrigin();
                spriteMap.depth    = (Depth)(float)(0.899999976158142 + 0.00999999977648258 * (double)index);
                spriteMap.position = new Vec2((float)((double)index * 9.41176414489746 - 16.0 + 16.0), -2f);
                graphicList.Add((Sprite)spriteMap);
            }
            this.graphic         = (Sprite)graphicList;
            this._editorName     = "team spawn";
            this.center          = new Vec2(8f, 5f);
            this.collisionSize   = new Vec2(32f, 16f);
            this.collisionOffset = new Vec2(-16f, -8f);
            this._visibleInGame  = false;
        }
Ejemplo n.º 7
0
 public InstantRevealer(IElement element, GraphicList graphics) :
     base(element, 0, false)
 {
     Graphics = graphics;
 }
Ejemplo n.º 8
0
 public FadeRevealer(IElement element, GraphicList graphics, float animationTime, bool easeAnimation) :
     base(element, animationTime, easeAnimation)
 {
     Graphics = graphics;
 }