Beispiel #1
0
        private void handleWorldInfo(BinaryReader data)
        {
            float worldX = (float)data.ReadDouble();
            float worldY = (float)data.ReadDouble();
            float worldW = (float)data.ReadDouble();
            float worldH = (float)data.ReadDouble();

            _world.SetPosition(new Vector2f(worldX, worldY));
            _world.SetSize(new Vector2f(worldW, worldH));

            Console.WriteLine("World info : # " + worldX + " # " + worldY + " # " + worldW + " # " + worldH);
        }
Beispiel #2
0
        public void UpdateWorldInfo(DataReader reader)
        {
            float left   = (float)reader.Read <double>();
            float top    = (float)reader.Read <double>();
            float right  = (float)reader.Read <double>();
            float bottom = (float)reader.Read <double>();

            _world.SetPosition(new Vector2f(((left + right) / 2), ((top + bottom) / 2)));
            _world.SetSize(new Vector2f(right - left, bottom - top));

            //Console.WriteLine("World info : # " + worldX + " # " + worldY + " # " + worldW + " # " + worldH);
        }