Advertisement
jewalky

Untitled

Mar 24th, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. class Doom3Doom : Element
  2. {
  3.     TextureID mDoom;
  4.    
  5.     override void OnCreate()
  6.     {
  7.         mRect = mParent.GetClientRect();
  8.         mRect.X = mRect.Width-320;
  9.         mRect.Y = mRect.Height-240;
  10.         mRect.Width = 320;
  11.         mRect.Height = 240;
  12.         Console.Printf("mRect = %f,%f,%f,%f", mRect.x, mRect.y, mRect.Width, mRect.Height);
  13.         mScale = 0.5;
  14.  
  15.         mDoom = TexMan.CheckForTexture("graphics/doom.png", TexMan.Type_Any);
  16.     }
  17.    
  18.     override void Draw()
  19.     {
  20.         Drawer d = GetDrawer();
  21.         Rect pc = GetClientRect();
  22.         d.DrawTexture(mDoom, false, pc.Width/2, pc.Height/2);
  23.     }
  24. }
  25.  
  26. class Doom3Element : Element
  27. {
  28.     TextureID mMouseCursor;
  29.    
  30.     override void OnCreate()
  31.     {
  32.         mRect = Rect.FromXYWH(0, 0, Screen.GetWidth(), Screen.GetHeight());
  33.         mScale = 2;
  34.    
  35.         mMouseCursor = TexMan.CheckForTexture("graphics/D3Mouse.png", TexMan.Type_Any);
  36.         AddChild(new('Doom3Doom').Init());
  37.     }
  38.  
  39.     override void Draw()
  40.     {
  41.         Drawer d = GetDrawer();
  42.         vector2 mouse = GetMouseXY();
  43.         d.DrawTexture(mMouseCursor, false, mouse.x, mouse.y);
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement