A generic graphical component that has a parent and children. Components that have hierarchical relations should inherits this class. Inherits from DrawableGameComponent.
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
コード例 #1
0
 public MessageWindow(Scene parent, Vector2 Position, string Message, MessageConfirmType destroyType)
     : base(parent, Position)
 {
     this.destroyType = destroyType;
     base.Text = Message;
     e = new MessageWindowEventArgs(Message, destroyType);
     Initialize();
 }
コード例 #2
0
 public TextArea(Scene parent, int Width, int Height, OnOvertaking overBehaviour)
     : base(parent)
 {
     Lines = new List<int>();
     Rows = new List<List<int>>();
     TextContent = new List<List<Text>>();
     Size = new Vector2(Width, Height);
     this.overBehaviour = overBehaviour;
 }
コード例 #3
0
 public Scene(Scene parent)
     : base(parent.Game)
 {
     Content = parent.Content;
     this.parent = parent;
     this.Enabled = parent.Enabled;
     this.Visible = parent.Visible;
     this.DrawOrder = parent != null ? parent.DrawOrder + 1 : 0;
     this.parent.Add(this);
 }
コード例 #4
0
 public Sprite(Scene parent, List<string> assetNames)
     : base(parent)
 {
     for (int i = 0; i < assetNames.Count; i++)
     {
         AnimationID.Add(assetNames[i], i);
     }
     SpriteSheet = new Texture2D[assetNames.Count];
     InitContent();
 }
コード例 #5
0
 public Interpretable GetInterpretable(string interpretableName, Scene parent)
 {
     Type type = assembly.GetType (interpretableName);
     if (type == null) {
         throw new Exception (String.Format ("Cannot find type {0} in interpreter {1}.",
                                             interpretableName,
                                             this.name));
     }
     object[] args = new object[1] {parent};
     return Activator.CreateInstance (type, args) as Interpretable;
 }
コード例 #6
0
 /// <summary>
 /// unpause the game, then fire the Unpaused event.
 /// </summary>
 public void UnPause(Scene sender, EventArgs e)
 {
     paused = false;
     if (UnPaused != null)
         UnPaused(sender, e);
     foreach (Scene subScene in subScenes)
         subScene.UnPause(this, e);
 }
コード例 #7
0
 /// <summary>
 /// Toogle the paused state of the scene.
 /// </summary>
 public void TooglePause(Scene sender, EventArgs e)
 {
     if (paused)
         UnPause(sender, e);
     else
         Pause(sender, e);
 }
コード例 #8
0
 public void Remove(Scene item)
 {
     subScenes.Remove(item);
     Game.Components.Remove(item);
 }
コード例 #9
0
 /// <summary>
 /// Pause the game, then fire the Paused event.
 /// </summary>
 public void Pause(Scene sender, EventArgs e)
 {
     paused = true;
     if (Paused != null)
         Paused(sender, e);
     foreach (Scene subScene in subScenes)
         subScene.Pause(this, e);
 }
コード例 #10
0
 public void RemoveTarget(Scene target)
 {
     try
     {
         int i = subScenes.IndexOf(target);
         if (targets.Contains(i))
             targets.Remove(i);
     }
     catch
     {
         throw new Exception("The requested target is not attached to the camera!");
     }
 }
コード例 #11
0
        public Sprite(Scene parent, List<Texture2D> assets, Effect effect)
            : base(parent)
        {
            int i = 0;
            SpriteSheet = new Texture2D[assets.Count];
            foreach (Texture2D asset in assets)
            {
                AnimationID.Add(asset.Name,i);
                SpriteSheet[i] = asset;
                i++;
            }

            afterImageEffect = effect;
        }
コード例 #12
0
 public Text(Scene parent, string spriteFontName)
     : base(parent)
 {
     this.spriteFontName = spriteFontName;
 }
コード例 #13
0
 public MyInterpretable(Scene parent)
     : base(parent)
 {
     sc = new SayCommand(parent, "Coucou, tu veux voir ma ville ?");
     sca = new SayCommand(parent, "Non merci.");
 }
コード例 #14
0
 public Window(Scene parent, Rectangle rect)
     : base(parent)
 {
     WindowRectangle = rect;
     Position = new Vector2(rect.X, rect.Y);
 }
コード例 #15
0
 public Camera(Scene parent, Vector2 position)
     : base(parent)
 {
     this.Position = position;
     ZoomOrigin = new Vector2(parent.Game.GraphicsDevice.Viewport.Width / 2, parent.Game.GraphicsDevice.Viewport.Height / 2);
 }
コード例 #16
0
 public Command(Scene parent)
     : base(parent)
 {
 }
コード例 #17
0
 public Interpretable(Scene parent)
     : base(parent)
 {
 }
コード例 #18
0
 public void Add(Scene item)
 {
     item.Enabled = this.Enabled;
     item.Visible = this.Visible;
     subScenes.Add(item);
     //Game.Components.Add(item);
 }
コード例 #19
0
 public MenuWindow(Scene parent, Vector2 Position,string Text)
     : base(parent, Position)
 {
     this.Text = Text;
     Initialize();
 }
コード例 #20
0
 public Bar(Scene parent, Vector2 Size)
     : base(parent)
 {
     this.Size = Size;
 }