Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: VS2103 VB  (Read 4051 times)

0 Members and 1 Guest are viewing this topic.

Shadow

  • Newbie
  • *
  • Posts: 3
    • View Profile
VS2103 VB
« on: June 17, 2014, 07:20:40 pm »
I am trying to program a RL game and looking for a fast drawing face. I found SFML that can support .net calling so I download and tried it. The progress is slow, but would like to use SFML for it.

Currently, I am running into a font creation problem, I would like to see if anyone had a similar setting like me and able to load the font properly in VB.

Thanks,
Shadow

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: VS2103 VB
« Reply #1 on: June 17, 2014, 07:54:07 pm »
What exactly is the problem?

I think the number of SFML VB programmers is very low, but there are certainly many experienced with SFML.NET and the .NET framework in general.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VS2103 VB
« Reply #2 on: June 18, 2014, 05:26:18 am »
Well I know VB6 and VB.NET (its where I started before C#)... But as Nexus said, what exactly is the problem? Can you please describe it in full detail and if it is a code issue then please post a complete and minimal example that shows the problem.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Shadow

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: VS2103 VB
« Reply #3 on: June 18, 2014, 01:56:00 pm »
Thanks Zsbzsb and Nexus.

I just return to home and recompile the code, this time it did not give out any error, but I fond the example use a method to draw text on screen cannot be found. Moreover, the event handler looks like not fired for close.

Here is my code, I just try to make it as simple as possible.

Module TestWithSFML

    Dim WithEvents NewWindow As RenderWindow

    Sub Main()

        Dim NewWindow As RenderWindow = New RenderWindow(New SFML.Window.VideoMode(1024, 768), "My New Window")
        Dim windowsFont As Font
        windowsFont = New Font("tahoma.ttf")
        Dim text = New Text("Hello", windowsFont)
        While (NewWindow.IsOpen())

            NewWindow.DispatchEvents()
            text.Position = New SFML.System.Vector2f(250.0F, 450.0F)
            text.Color = New Color(255, 255, 255, 170)

        End While


    End Sub

    ''' <summary>
    ''' Function called when the window is closed
    ''' </summary>
    Sub App_Closed(ByVal sender As Object, ByVal e As EventArgs) Handles NewWindow.Closed
        Dim window = CType(sender, RenderWindow)
        window.Close()
    End Sub

    ''' <summary>
    ''' Function called when a key is pressed
    ''' </summary>
    Sub App_KeyPressed(ByVal sender As Object, ByVal e As KeyEventArgs) Handles NewWindow.KeyPressed
        Dim window = CType(sender, RenderWindow)
        If e.Code = Keyboard.Key.Escape Then
            window.Close()
        End If
    End Sub

End Module
 

Thanks.
Shadow

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VS2103 VB
« Reply #4 on: June 18, 2014, 02:18:08 pm »
You should take another look at the official tutorials and examples. You need to call clear / draw (on your text object) / display every frame or nothing will be displayed on the screen.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VS2103 VB
« Reply #5 on: June 18, 2014, 02:35:45 pm »
... except the VB example, which is massively outdated.

http://en.sfml-dev.org/forums/index.php?topic=15003.msg110775#msg110775
Laurent Gomila - SFML developer

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: VS2103 VB
« Reply #6 on: June 18, 2014, 03:37:12 pm »
Well it isn't anymore  :D
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: VS2103 VB
« Reply #7 on: June 18, 2014, 04:11:26 pm »
Quote
Well it isn't anymore  :D
... in the latest development revision.
Laurent Gomila - SFML developer

Shadow

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: VS2103 VB
« Reply #8 on: June 18, 2014, 04:51:15 pm »
I will try to look into some video to see how I can proceed.

Thanks for comment.

Shadow

 

anything