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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - makerimages

Pages: 1 [2]
16
General / Setting up on notepad++
« on: June 17, 2013, 12:36:29 pm »
Hello there!
I thought to re-learn c++ and SFML and I wan  to use notepad++ as my editor, compile with MinGW using a custom .bat file. How should I set Up SFML so that It would run?

My current .bat file
gcc -o DreadDylum source/main.cpp
DreadDylum
PAUSE

 

17
Allright I made those to a class (separate .h and .cpp) I make the sprites and textures in constructors. The only problem is that the SpriteManager.cpp doing sf::Sprite NewGamesprite(NewGameTex) says that the NewGameTex was not declared in this scope. Its the only problem I have, how to fix? i have included the TextureManager.h.

18
Can soeone just give me a pointer on what to do tho solve this??

19
Seems, that altough I made a function for those, it now gives scope errors.

TextureManager.h:

#ifndef TEXTUREMANAGER_H_INCLUDED
#define TEXTUREMANAGER_H_INCLUDED

#include <SFML/Graphics.hpp>
using namespace std;
void loadTextures()
{

sf::Texture texture;
 texture.loadFromFile("/data/textures/menu/New Game.pdn");


}
#endif // TEXTUREMANAGER_H_INCLUDED



 

SpriteManager.h:

#ifndef SPRITEMANAGER_H
#define SPRITEMANAGER_H
#include <SFML/Graphics.hpp>
#include "TextureManager.h"
using namespace std;
void loadSprites()
{
  sf::Sprite NewGamesprite(texture);
 

}





#endif // SPRITEMANAGER_H



 

main.cpp:

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <iostream>
#include "Character.h"
#include "TextureManager.h"
#include "SpriteManager.h"
using namespace std;

int main()
{
loadTextures();
loadSprites();
  sf::RenderWindow window(sf::VideoMode(800, 600), "Reckon Dash.exe", sf::Style::Default);


cout <<"Window open"<<endl;
  // run the program as long as the window is open
    while (window.isOpen())
    {


        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
            {
                window.close();

            }
        }

    window.clear();
    window.display();
    window.draw(NewGamesprite);

    }
return 0;
}


 

in the loadsprites it says that texture was not declared in this scope and in main.cpp it says that NewGamesprite was not declared in this scope. How to fix??

20
You are aware that statements must be inside functions? You can't just put them in headers.
How stupid of me,, that was it.

You should really learn C++ before you use SFML...
I recommend you to start with how C++ compiles, since it appears you have many problems regarding that matter.
Dont get mad at me, my brain crashed in the C++ department for a few hours yesterday...

21
Hi, I have a header file, which includes the graphics.hpp, in it I make a texture:

sf::Texture texture;
texture.loadFromFile("/data/textures/menu/New Game.pdn");

In another.h file, in which I include this .h file, I create a sprite:

sf::Sprite sprite(texture);



In my main.cpp, I include both of these headers and the graphics.hpp and I do:

window.draw(sprite);
If I now build and run the code, then It errors in the texture.loadFromFile line, saying:

Expected constructor, deconstructo or type conversion before . token

How to fix??

22
Graphics / Re: Sprites into an array
« on: December 29, 2012, 09:45:24 am »
Nevermind, Ill ditch the array approach, I dont even know anymore why I wanted it... (Ill have a project topic created soon for a game I`m working on...)

23
Graphics / Sprites into an array
« on: December 28, 2012, 12:59:07 pm »
Hello, how can I load a bunch of sprites into a array in a separate file (should it be .h or .cpp), so that I can later display them  (and set as a variable) in a different file by using the index??? 


Edit: could I make the sprites before making an array and then load either a pointer to those or those directly to an array???

24
General / simple way for multiple screens
« on: December 27, 2012, 12:08:52 pm »
Hello, I`m new here and I only started learning C++ and SFML about 2 months ago.

I`d like to know if there is a simple way to handle multiple screens in a game. Since Eng is not my native (I`m from Estonia) the http://www.sfml-dev.org/wiki/en/tutoriels/multiecransjeu_en was a bit tricky to undrestand( i do know english VERY GOOD, it just that the overall construction of the screen management reamined a bit fuzzy).

If you know any simple multiple screen managements or can describe how it works in general, I`d be very happy

Pages: 1 [2]
anything