Beispiel #1
0
 private void On_Destroy( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Sprite self = selfInstance as xgc3.Generated.Sprite;
     Console.WriteLine( "Spite - Destroy");
     // TODO: Test Leak cleanup
     if (self.Texture != null)
     {
         self.Texture.Dispose();
         self.Texture = null;
     }
 }
Beispiel #2
0
        private void On_Draw( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
        {
            xgc3.Generated.Sprite self = selfInstance as xgc3.Generated.Sprite;
            //Console.WriteLine( "Sprite - Draw");
            string resource = self.Resource;
            if (resource != null)
            {
                Vector2 p = new Vector2(self.X, self.Y);
                self.GameMgr.Game.GameComponent.SpriteB.Draw(self.Texture, p, Color.White);
            }
            else
            {
                // When no sprite? Just draw name.

                Vector2 p = new Vector2(self.X, self.Y);
                self.GameMgr.Game.GameComponent.SpriteB.DrawString(self.GameMgr.Game.FontMgr.Courier, self.Name, p, Color.Red);
            }
        }
Beispiel #3
0
 private void On_Draw( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Label self = selfInstance as xgc3.Generated.Label;
       Vector2 p = new Vector2(self.X, self.Y);
       string text = self.Text;
       if( text == null)
       {
     text = self.Name;
       }
       self.GameMgr.Game.GameComponent.SpriteB.DrawString(self.GameMgr.Game.FontMgr.Courier, text, p, self.Color);
 }
Beispiel #4
0
 private void On_Create( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Sprite self = selfInstance as xgc3.Generated.Sprite;
     Console.WriteLine( "Spite - Create");
     string resource = self.Resource;
     if (resource != null)
     {
         Texture2D texturePointer = self.GameMgr.Game.Content.Load<Texture2D>(resource);
         self.Texture = texturePointer;
     }
 }
Beispiel #5
0
 private new void On_Step( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Application_GameObjects.Room_Editor.Sprite_flower3 self = selfInstance as xgc3.Generated.Application_GameObjects.Room_Editor.Sprite_flower3; self.X = self.X+1; if( self.X > 200) { self.X = 0;}
 }
Beispiel #6
0
 private void On_Step( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.FPS self = selfInstance as xgc3.Generated.FPS;
     xgc3.GameObjects.GameTimer gameTimer = other as xgc3.GameObjects.GameTimer;
     this.Text = string.Format( this.Format, Math.Round( gameTimer.FPS, 2));
 }
Beispiel #7
0
        private void On_Draw( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
        {
            xgc3.Generated.Button self = selfInstance as xgc3.Generated.Button;
            //Console.WriteLine( "Sprite - Draw");
            if (self.Resource != null)
            {
                Vector2 p = new Vector2(self.X, self.Y);

                // Scale button graphic...
                DrawTiledTexture( self.GameMgr.Game.GameComponent.SpriteB, self.Resource.GetTexture( self.GameMgr), self.X, self.Y, self.Width, self.Height, Color.White, 5);

                // Now, draw the text inside the button.
                Rectangle textBounds;
                Rectangle r = new Rectangle( self.X, self.Y, self.Width, self.Height);
                DrawString( self.GameMgr.Game.GameComponent.SpriteB, self.GameMgr.Game.FontMgr.Courier, self.Text, r,
                    Color.Black, TextAlignment.Middle, true, new Vector2(0,0), out textBounds);

            }
            else
            {
                // When no resource, Just draw name.
                Vector2 p = new Vector2(self.X, self.Y);
                self.GameMgr.Game.GameComponent.SpriteB.DrawString(self.GameMgr.Game.FontMgr.Courier, self.Name, p, Color.Red);
            }
        }
Beispiel #8
0
 private void On_BarEvent( xgc3.Core.Instance self, xgc3.Core.Instance other, String extra)
 {
     Console.WriteLine( "Hello world!");
 }
Beispiel #9
0
 private void On_Create( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Button self = selfInstance as xgc3.Generated.Button;
     Console.WriteLine( "Sprite - Create");
     this.Resource = normal;
 }
Beispiel #10
0
 private void On_Destroy( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Button self = selfInstance as xgc3.Generated.Button;
     Console.WriteLine( "Sprite - Destroy");
     // TODO - Free up resources?
 }
Beispiel #11
0
 public void On_Click( xgc3.Core.Instance self, xgc3.Core.Instance other, String extra)
 {
 }
Beispiel #12
0
 private new void On_Draw( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Application_GameObjects.Room_Editor.TextBox_TextBox1 self = selfInstance as xgc3.Generated.Application_GameObjects.Room_Editor.TextBox_TextBox1;
       Vector2 p = new Vector2(self.X, self.Y);
       self.GameMgr.Game.GameComponent.SpriteB.DrawString(self.GameMgr.Game.FontMgr.Courier, self.Text, p, self.Color);
 }
Beispiel #13
0
 private new void On_Step( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Application_GameObjects.Room_Editor.TextBox_flower4 self = selfInstance as xgc3.Generated.Application_GameObjects.Room_Editor.TextBox_flower4; self.Y = self.Y+1; if( self.Y > 200) { self.Y = 0;}
 }
Beispiel #14
0
 private void On_Create( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.TextBox self = selfInstance as xgc3.Generated.TextBox; Console.WriteLine( "Hello world!" + self.Name);
 }
Beispiel #15
0
 private void On_LeftMouseUp( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Button self = selfInstance as xgc3.Generated.Button;
       this._msdown = false;
       this._callShow();
       this.Raise_Click( this, null, null);
 }
Beispiel #16
0
 private void On_Draw( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.TextBox self = selfInstance as xgc3.Generated.TextBox;
       Vector2 p = new Vector2(self.X, self.Y);
       self.GameMgr.Game.GameComponent.SpriteB.DrawString(self.GameMgr.Game.FontMgr.Courier, self.Text, p, self.Color);
 }
Beispiel #17
0
 private void On_MouseOver( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Button self = selfInstance as xgc3.Generated.Button;
       this._msin = true;
       this._callShow();
 }
Beispiel #18
0
 private new void On_Create( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Application_GameObjects.Room_Editor self = selfInstance as xgc3.Generated.Application_GameObjects.Room_Editor; Console.WriteLine( "Hello world!");
 }
Beispiel #19
0
 private new void On_Click( xgc3.Core.Instance selfInstance, xgc3.Core.Instance other, String extra)
 {
     xgc3.Generated.Application_GameObjects.Room_Editor.Button_Button1 self = selfInstance as xgc3.Generated.Application_GameObjects.Room_Editor.Button_Button1; Console.WriteLine("Button click!");
 }