Advertisement
szymski

Untitled

Nov 8th, 2015
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. public override void Render()
  2.         {
  3.             GL.PushMatrix();
  4.  
  5.             GL.Color3(1f, 1f, 1f);
  6.  
  7.             // Translate to camera position
  8.             GraphicsHelper.Translate(Screen.Size / 2f);
  9.             GL.Scale(Client.Camera.zoom, Client.Camera.zoom, 1f);
  10.             GraphicsHelper.Translate(-Client.Camera.position);
  11.  
  12.             // Render the level
  13.             level.Render();
  14.  
  15.             // Draw object under cursor
  16.             if (selectedObject != null)
  17.             {
  18.                 GL.Color4(1f, 1f, 0.2f, 0.4f);
  19.                 GL.PushMatrix();
  20.                 GraphicsHelper.Translate(GetGridMousePos());
  21.                 selectedObject.Sprite.Draw(selectedFrame);
  22.                 GL.PopMatrix();
  23.             }
  24.  
  25.             GL.PopMatrix();
  26.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement