A generic graphical component that has a parent and children. Components that have hierarchical relations should inherits this class. Inherits from DrawableGameComponent.
Наследование: Microsoft.Xna.Framework.DrawableGameComponent
 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();
 }
 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;
 }
 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)
 {
 }
 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;
 }