Beispiel #1
0
        public DisplayObject(Image img, Point location, CoronaObject coronaObjectParent)
        {
            this.surfaceRect = new Rectangle();
            this.surfaceRect.Size = img.Size;

            this.surfaceRect.Location = location;
            InitialRect = this.surfaceRect;

            this.Name = "";
            this.type = "IMAGE";
            this.image = img;

            CurrentFrame = 0;
            Alpha = 1.0F;

            this.GradientColor = new GradientColor();
            this.CoronaObjectParent = coronaObjectParent;
        }
Beispiel #2
0
        public DisplayObject(Figure fig,CoronaObject coronaObjectParent)
        {
            this.Name = "Figure";
            this.type = "FIGURE";
            this.Figure = fig;
            this.Figure.DisplayObjectParent = this;

            if (this.Figure.ShapeType.Equals("RECTANGLE"))
            {
                Rect rect = this.Figure as Rect;
                this.surfaceRect = rect.getBounds(new Matrix());
            }
            else if (this.Figure.ShapeType.Equals("CIRCLE"))
            {
                Cercle cercle = this.Figure as Cercle;
                this.surfaceRect = cercle.getBounds(new Matrix());
            }
            else if (this.Figure.ShapeType.Equals("LINE"))
            {
                Line line = this.Figure as Line;

                this.surfaceRect = line.getBounds(new Matrix());
            }
            else if (this.Figure.ShapeType.Equals("TEXT"))
            {
                Texte text = this.Figure as Texte;
                this.surfaceRect = new Rectangle(text.Position,
                    System.Windows.Forms.TextRenderer.MeasureText(text.txt,
                    new Font(text.font2.FamilyName,text.font2.Size, text.font2.Style)));
            }
            else if (this.Figure.ShapeType.Equals("CURVE"))
            {
                CourbeBezier courbe = this.Figure as CourbeBezier;
                this.surfaceRect = courbe.getBounds(new Matrix());
            }

            Alpha = 1.0F;
            this.GradientColor = new GradientColor();
            this.CoronaObjectParent = coronaObjectParent;
        }
Beispiel #3
0
        public DisplayObject(GorgonLibrary.Graphics.Sprite gorgonSprite, Point location, CoronaObject coronaObjectParent)
        {
            this.surfaceRect = new Rectangle();
            this.GorgonSprite = gorgonSprite;

            this.surfaceRect.Size = new Size(GorgonSprite.Image.Width, GorgonSprite.Image.Height) ;

            this.surfaceRect.Location = location;
            InitialRect = this.surfaceRect;

            this.Name = "";
            this.type = "IMAGE";

            CurrentFrame = 0;
            Alpha = 1.0F;

            this.GradientColor = new GradientColor();
            this.CoronaObjectParent = coronaObjectParent;
        }
Beispiel #4
0
        public DisplayObject(CoronaSpriteSet spriteSet, Point location, CoronaObject coronaObjectParent)
        {
            this.type = "SPRITE";
            Alpha = 1.0F;
            this.SpriteSet = spriteSet;
            this.SpriteSet.DisplayObjectParent = this;

               this.surfaceRect = new Rectangle(location,new Size(50,50));

            InitialRect = this.surfaceRect;
            this.CoronaObjectParent = coronaObjectParent;
            this.GradientColor = new GradientColor();

            this.CurrentFrame = SpriteSet.indexFrameDep;
        }