Re: Is learning visual basic worth it?
Hi there,
Sorry, Steve, but as I said, visual basic is totally new for me and I have no time to code examples (anyway, my examples will not be more useful, my visual basic knowledge is near to 0).
THis is what I tried yesterday:
1. CCreates and shows a window.
2. Subscribe two methods to their events, and each method is declared below.
3. WHen you press m: displays a message.
4. when you press c, the application closes.
Please, note that this code could be buggy and probably a real visual basic developer will never forget me for doing this... thing.
You need references to sfml library on your project in order to make it work:
Imports SFML.System
Imports SFML.Window
Module MainModule
Dim MainWindow As New Window(SFML.Window.VideoMode.DesktopMode, "Hello, world")
Sub Main()
AddHandler MainWindow.KeyPressed, AddressOf OnKeyPressedEvent
&nbs
p; AddHandler MainWindow.Closed, AddressOf OnClosedEvent
MainWindow.Display()
While True
MainWindow.DispatchEvents()
End While
End Sub
Public Sub OnClosedEvent(source As Object, e As EventArgs)
MainWindow.Close()
End Sub
Public Sub OnKeyPressedEvent(source As Object, e As KeyEventArgs)
Select Case e.Code
Case Keyboard.Key.M
MsgBox("Hello, world, again!")
Case Keyboard.Key.C
CloseWindow()
End Select
End Su
b
End Module
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector