Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports GorgonLibrary
- Imports GorgonLibrary.Graphics
- Imports Drawing = System.Drawing
- Public Class Form1
- Dim mySprite As Sprite
- Dim mytext As TextSprite
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Gorgon.Initialize(False, False)
- Gorgon.SetMode(Me)
- mySprite = New Sprite("MySprite",
- GorgonLibrary.Graphics.Image.FromFile(Environment.CurrentDirectory & "\Bioman.png"))
- mySprite.Smoothing = Smoothing.MagnificationSmooth
- Dim myfont As GorgonLibrary.Graphics.Font
- myfont = Graphics.Font.FromFile(Environment.CurrentDirectory & "\Assets\ClearwerkCraftRemix.ttf", 100)
- With myfont
- .AntiAlias = True
- .OutlineColor = Color.Black
- .OutlineWidth = 2
- .Bold = True
- End With
- mytext = New TextSprite("HW", "Hello Wurld", myfont)
- With mytext
- .Text = "Hello Wurld"
- .Size = New Vector2D(20, 20)
- .Position = New Vector2D(100, 100)
- .Shadowed = True
- .ShadowDirection = FontShadowDirection.LowerRight
- .ShadowOffset = New Vector2D(10, 10)
- End With
- AddHandler Gorgon.Idle, AddressOf Gorgon_Idle
- Gorgon.Go()
- End Sub
- Private Sub Gorgon_Idle(sender As Object, e As GorgonLibrary.Graphics.FrameEventArgs)
- 'Debug.WriteLine("Idle")
- Me.Text = e.FPS
- Gorgon.Screen.Clear()
- Dim CenterToScreen As Vector2D = New Vector2D(Gorgon.Screen.Width * 0.5F,
- Gorgon.Screen.Height * 0.5F)
- mySprite.Axis = New Vector2D(mySprite.Image.Width * 0.5F,
- mySprite.Image.Height * 0.5F)
- mySprite.Position = CenterToScreen
- mySprite.Rotation += (10.0F * e.FrameDeltaTime)
- mySprite.Scale += New Vector2D(0.1F, 0.1F) * e.FrameDeltaTime
- If (mySprite.Scale.X > 2.0F) Then
- mySprite.Scale = New Vector2D(0.5F, 0.5F)
- End If
- mySprite.Draw()
- mytext.Draw()
- Gorgon.CurrentRenderTarget.Rectangle(10, 10, 400, 300, Color.Black)
- Return
- End Sub
- Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
- Debug.WriteLine(e.Location.ToString)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment