stigzler

gorgon artefacts

Oct 7th, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.03 KB | None | 0 0
  1. Imports GorgonLibrary
  2. Imports GorgonLibrary.Graphics
  3. Imports Drawing = System.Drawing
  4.  
  5.  
  6. Public Class Form1
  7.  
  8.     Dim mySprite As Sprite
  9.     Dim mytext As TextSprite
  10.  
  11.  
  12.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  13.  
  14.         Gorgon.Initialize(False, False)
  15.         Gorgon.SetMode(Me)
  16.  
  17.         mySprite = New Sprite("MySprite",
  18.         GorgonLibrary.Graphics.Image.FromFile(Environment.CurrentDirectory & "\Bioman.png"))
  19.         mySprite.Smoothing = Smoothing.MagnificationSmooth
  20.  
  21.         Dim myfont As GorgonLibrary.Graphics.Font
  22.         myfont = Graphics.Font.FromFile(Environment.CurrentDirectory & "\Assets\ClearwerkCraftRemix.ttf", 100)
  23.         With myfont
  24.             .AntiAlias = True
  25.             .OutlineColor = Color.Black
  26.             .OutlineWidth = 2
  27.             .Bold = True
  28.         End With
  29.  
  30.         mytext = New TextSprite("HW", "Hello Wurld", myfont)
  31.         With mytext
  32.             .Text = "Hello Wurld"
  33.             .Size = New Vector2D(20, 20)
  34.             .Position = New Vector2D(100, 100)
  35.             .Shadowed = True
  36.             .ShadowDirection = FontShadowDirection.LowerRight
  37.             .ShadowOffset = New Vector2D(10, 10)
  38.         End With
  39.  
  40.  
  41.  
  42.         AddHandler Gorgon.Idle, AddressOf Gorgon_Idle
  43.  
  44.         Gorgon.Go()
  45.  
  46.  
  47.     End Sub
  48.  
  49.     Private Sub Gorgon_Idle(sender As Object, e As GorgonLibrary.Graphics.FrameEventArgs)
  50.  
  51.         'Debug.WriteLine("Idle")
  52.         Me.Text = e.FPS
  53.         Gorgon.Screen.Clear()
  54.         Dim CenterToScreen As Vector2D = New Vector2D(Gorgon.Screen.Width * 0.5F,
  55.                                                       Gorgon.Screen.Height * 0.5F)
  56.  
  57.         mySprite.Axis = New Vector2D(mySprite.Image.Width * 0.5F,
  58.                         mySprite.Image.Height * 0.5F)
  59.  
  60.         mySprite.Position = CenterToScreen
  61.         mySprite.Rotation += (10.0F * e.FrameDeltaTime)
  62.  
  63.         mySprite.Scale += New Vector2D(0.1F, 0.1F) * e.FrameDeltaTime
  64.         If (mySprite.Scale.X > 2.0F) Then
  65.             mySprite.Scale = New Vector2D(0.5F, 0.5F)
  66.         End If
  67.  
  68.         mySprite.Draw()
  69.         mytext.Draw()
  70.  
  71.         Gorgon.CurrentRenderTarget.Rectangle(10, 10, 400, 300, Color.Black)
  72.  
  73.  
  74.         Return
  75.  
  76.  
  77.     End Sub
  78.  
  79.     Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
  80.         Debug.WriteLine(e.Location.ToString)
  81.     End Sub
  82. End Class
Advertisement
Add Comment
Please, Sign In to add comment