Welcome, Guest. Please login or register.

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: How do I make a text box which only accepts numbers?
« Last post by G. on Today at 02:59:17 am »
Definitely use the TextEntered event. You don't care how the user entered the number, for 1 it could be Numpad1, Num1, alt+49, or whatever.
2
General / Re: How do I make a text box which only accepts numbers?
« Last post by Kanoha on December 09, 2018, 10:15:05 pm »


I haven't read everything posted, but wouldn't it make more sense to only accept key input from number keys rather than listening to TextEntered? Send sf::Keyboard::Key as a parameter to your textbox class when keys 0 to 9 are pressed.

To me, it makes more sense to use the Event::TextEntered approach, first because it is easier to implement, and secondly because it has been created for this purpose  unlike sf::Keyboard (I think so at least).

Sent from my SM-G950F using Tapatalk

3
General / Re: How do I make a text box which only accepts numbers?
« Last post by NGM88 on December 09, 2018, 08:31:17 pm »
I haven't read everything posted, but wouldn't it make more sense to only accept key input from number keys rather than listening to TextEntered? Send sf::Keyboard::Key as a parameter to your textbox class when keys 0 to 9 are pressed.
4
General / Re: LNK1104 Error
« Last post by fl1ppyXD on December 09, 2018, 08:30:47 pm »
Yea i added the additional libary directorys.


Quote
1>------ Build started: Project: zjalicpeder, Configuration: Debug Win32 ------
1>Microsoft (R) Incremental Linker Version 14.15.26730.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>
1>"/OUT:C:\Users\filip\source\repos\zjalicpeder\Debug\zjalicpeder.exe" /INCREMENTAL "/LIBPATH:C:\SFMLBUILDS\SFMLVS2017\SFML-2.5.1\lib" "sfml-system-d.lib" "sfml-graphics-d.lib" "sfml-audio-d.lib" "sfml-network-d.lib" "sfml-window-d.lib" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG:FASTLINK "/PDB:C:\Users\filip\source\repos\zjalicpeder\Debug\zjalicpeder.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:C:\Users\filip\source\repos\zjalicpeder\Debug\zjalicpeder.lib" /MACHINE:X86 Debug\zjalicpeder.obj
1>LINK : fatal error LNK1104: cannot open file 'sfml-window-d.lib'
1>Done building project "zjalicpeder.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

5
General / Re: Game developments by example - handle Input Class
« Last post by NGM88 on December 09, 2018, 08:22:44 pm »
"Syntax is ridiculously hard" only proportional to your c++ knowledge. I would recommend improving your c++ rather than trying to simplify the book to your level of c++. Whatever it is that you don't understand in the book, learn it using a good c++ source. This will be a better investment of your time.
6
Graphics / Re: sf::Texture Sizes
« Last post by NGM88 on December 09, 2018, 08:15:04 pm »
1 - True. The cost of a texture bind is fixed, it's not based on size.

2 - Should be fine as far as I know. Maybe ask a dev just in case.
7
General / Re: LNK1104 Error
« Last post by eXpl0it3r on December 09, 2018, 08:12:56 pm »
Did you change the additional library directory?

Can you provide the verbose build output?
https://www.sfml-dev.org/faq.php#tr-grl-verbose-ide
8
General / LNK1104 Error
« Last post by fl1ppyXD on December 09, 2018, 07:38:41 pm »
I have tried setting up SFML 3 times now on Visual Studio 2013 and 2017.
On both versions i get the same error : 1>LINK : fatal error LNK1104: cannot open file 'sfml-window-d.lib'
I have followed the tutorial from the SFML site and i have also followed a tutorial from youtube.
In the linker input in the additional dependices i have checked if sfml-window-lib is added and it is i didnt miss it. Then i thought mayebe it was missing in the SFML folders but its also present there. I have tried using the x86 and x64 versions of SFML and i get the same error on both.
9
SFML projects / Re: Nero Game Engine
« Last post by Sk Landry on December 09, 2018, 07:03:16 pm »
Hi everyone, how do you do, Hope your are doing great.  :)

Twitter account

I opened a Twitter account some days ago, you can follow me and stay update any time on the Engine development.
Twitter - NeroGameEngine.

Scene Screens

Today we are going to talk Screens. This is a new feature in the Engine, I did not plan it for the first version, but I finally thought it would be cool to have it.

What is a Screen ?

First, let's begin by what most people know : Game States. In a Game we generally have several states like : the game levels (each level being a state), the start menu, the pause menu, the options menu and many more. In order to manage all those states people generally develop a Sates and States_Stack system. In this system you can switch between States by pushing or poping them.

Instead of using a State/States_Stack System, the Nero Game Engine will use two differents systems. the Screen System and the World Chunk System. Those two systems combined will offer more power than a simple State System.

  • Screens :
Screens are displayed on top of the Game world. They can be used to build game menu but they can also be used as a UI Panel (window) in a menu.
  • World Chunk :
A World Chunk is a part of the Game World that can be load or destroy dynamically (during the game). Therefore One World chunk can represent a game level, but also, One game level can have any number of World chunks. The ability to load and destroy World Chunks dynamically will allows to build very large level. World Chuncks will be added in the second version of Engine.


Add, Delete and Rename Screens

On the top left of the Engine Interface, just after the Utility_Tab, we now have the Screen_Tab. From this tab, we can see all the available Screens, add new Screens, delete Screens or rename Screens.

Each Scene always has at least one Screen, you can delete any Screens but once it left only one Screen, the delete button will have no effect.




World View and Screen View

By default the Engine start in the World View. In order to access Screens we need to switch to the Screen View. On the right of the Engine Interface there is a button called Screen View. It's a toggle button, when the button is activated we goes in Screen View, when it's desactivated we come back to the World View.



The current View mode is also displayed on the bottom right of the canvas.



Just below the Screen View button there is a list that allows to select a Screen.




Build Screens

When a Screen is selected we can start building it. Each Screen has its own Canvas color, its own Grid, its own Camera, its own layers. Basically everything you do when a Screen is selected will affect only that Screen. Each Screen maintains its own Undos and Redos

Not all types of Objects can be added to a Screen. There is no Physics in a Screen, Therefore it's not possible to add Mesh_Objects, Meshed_Objects (Sprite with Mesh) and Animation_Meshed_Objects (Animation with Mesh) In Screens.

We can only add Sprite_Objects, Animation_Objects, Text_Objects and Button_Objects.

Button_Object is a new type of Object that can be add on Screens but not in the Game World, I will present it in my next post.

Screen and Grid

In my last post, I said that the Grid was important for Screens, it's time to know why. Screens are rendered on top of the Game World and they are not affected by the Camera movement. Therefore in order to be visible a Screen must be contained in a strict area. Since the Canvas is infinite it's become easy to be lost. This is were the Grid comes, if you plan to render your game in a 800 x 600 resolution or a 1024 x 800 resolution, you will have to configure a Grid of the same resolution with an offset of (0, 0). The Grid will represent the Screen area and everything in the Grid will be displayed.

That's all for this post, there is more on Screens but that will be for the next post. The video shows the different Screens I built for the Adventure Scene.

10
DotNet / Re: .NET DispatchEvents problem
« Last post by gualtyphone on December 09, 2018, 03:00:33 pm »
UPDATE:
To eliminate any and all confusion I made a new project and the most basic implementation of a game loop I could
namespace TestSFML
{
    class MainClass
    {
        private static RenderWindow _window;
        public static void Main(string[] args)
        {
            _window = new RenderWindow(new VideoMode(800, 600), "SFML window");
            _window.SetVisible(true);
            _window.Closed += new EventHandler(OnClosed);
            Clock clock = new Clock();
            float timePassed = 0f;
            float previousTimePassed = 0f;
            float dt = 0;
            while (_window.IsOpen)
            {
                timePassed = clock.ElapsedTime.AsSeconds();
                dt = timePassed - previousTimePassed;
                _window.DispatchEvents();
                _window.Clear(Color.Red);
                Debug.WriteLine((1.0f / dt).ToString());
                _window.Display();
                previousTimePassed = timePassed;
            }
        }

        private static void OnClosed(object sender, EventArgs e)
        {
            _window.Close();
        }
    }
}
 

And the issue is still present on multiple machines... Don't really know where to go from here...
Pages: [1] 2 3 ... 10
anything