public Minima() { GameObjectManager = new GameObjectManager(); SystemManager = new SystemManager(); ObjectBuffer = new ObjectBuffer(); _mutex = new Mutex(); _instance = this; }
public GameObject(string name) { Id = new ObjectID(); Name = name; _components = new Dictionary <Type, GameComponent>(); Minima.GetInstance().GameObjectManager.AddGameObject(this); }
public override void OnUpdate(GameObject gameObject) { var a = gameObject.GetComponent <RenderComponent>(); var b = gameObject.GetComponent <TransformComponent>(); var s = (Sprite)a.Drawable; if (s.GetGlobalBounds().Intersects(Minima.GetInstance().Camera.GetView().Viewport)) { //if (IsInView(b.LocalPosition, s.TextureRect)) a.Drawable.Draw(Minima.GetInstance().Window, b._it.Transform); } }
internal void Update() { OnUpdateStart(); var objects = Minima.GetInstance().ObjectBuffer.GetGameObjects(Components.ToArray()); for (var index = 0; index < objects.Count; index++) { var a = Minima.GetInstance().GameObjectManager.GetGameObjectByID(objects[index]); OnUpdate(a); } OnUpdateEnd(objects); }
public void Draw() { RenderStates states = new RenderStates() { BlendMode = BlendMode.None, Transform = Transform.Identity, Texture = _texture, Shader = null }; _batch.Draw(Minima.GetInstance().Window, states); var s = new Sprite(); s.TextureRect = new IntRect(0, 0, 10, 10); s.Draw(Minima.GetInstance().Window, new RenderStates() { BlendMode = BlendMode.None, Transform = Transform.Identity, Texture = _texture, Shader = null }); _batch.Clear(); }
public override void OnUpdateStart() { Minima.GetInstance().Window.Clear(Color.Black); }
internal void Init(GameObject gameObject) { Minima.GetInstance().ObjectBuffer.AddGameObject(this.GetType(), gameObject); }