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 - santiaboy

Pages: 1 ... 3 4 [5] 6 7 8
System / Re: [Linux] using sf::String makes the accents disapear
« on: August 19, 2013, 08:05:58 pm »
Did you try std::wstring on Linux?

Yes I did. Weird thing is, the purpose of the std::string in linux are the std::wstring in windows.

@FRex, thanks! I'm going to try it and hopefully it will work :)

System / [Linux] using sf::String makes the accents disapear
« on: August 19, 2013, 02:52:10 am »
Hey guys, I've made a game in windows and was trying to port it to Linux. The game uses accents, so in windows I use std::wstrings. However, in linux, you don't have to use wstrings, but std::strings.

However, I have a problem: In windows works perfectly, but in linux it doesn't.

Example code

#include <iostream>
#include <fstream>
#include <SFML/System.hpp>

int main()
    std::fstream fin("folder/file");
    std::string aux = "";
        sf::String sfmlAux;
    while(getline(fin, aux)){
        std::cout << aux << std::endl;
                sfmlAux = aux;
                aux = sfmlAux;
                std::cout << aux << std::endl;

    return 0;


the file contains
Code: [Select]
in UTF-8

The output of the program:
Code: [Select]

Thing is, using wstrings in windows works like a charm. I just change wstrings for strings (linux) and it doesn't work. Any ideas?

Feature requests / Re: Rounded Rectangle
« on: May 01, 2013, 11:03:16 pm »
You can create your own roundedRectangle class!

It's just a sf::RectangleShape and 4 sf::CircleShape, taped together with duct tape

General discussions / Re: SFML 2 and its new website released
« on: April 30, 2013, 03:28:20 am »
I like it, it's slick ;D

General / Re: SFML 2.0 in Linux
« on: April 30, 2013, 03:02:49 am »
...an issue on the lack of knowledge on how Linux works...

That might explain it, as I have little to none Linux knowledge. I guess I'll wait for the official packages, as I fear I will make a mess otherwise.

Thanks though!

General / Re: SFML 2.0 in Linux
« on: April 30, 2013, 02:37:30 am »
Shouldn't this be included in the tutorial? I mean, I followed it exactly as it said in the tutorial, and still couldn't get the program running...

Also, I could do that? Is there any other option? An easier one perhaps? :P

General / SFML 2.0 in Linux
« on: April 30, 2013, 02:00:53 am »
Hey guys, as 2.0 was released I wanted to try and code in Linux, too. I downloaded the file and then extracted it (because the sudo command brought me 1.6 :( )

However, when I try to do everything as the tutorial says, this happens:
||warning: libGLEW.so.1.7, needed by /home/santi/SFML-2.0/lib/libsfml-graphics.so, not found (try using -rpath or -rpath-link)|
/home/santi/SFML-2.0/lib/libsfml-graphics.so||undefined reference to `__glewUniform1fARB'|
//and 38 more errors

It happens when I try to compile via code::blocks, and via console, too! (It compiles, but the linker fails)

Aparently, I have a newer libGLEW, and that's why the error happens...so, any way to fix it? :p

EDIT: I don't know if it changes something, but I am using ubuntu 12.10

SFML projects / Re: Space Dash - A very simple space side-scroller
« on: April 28, 2013, 09:14:10 pm »
Thanks for the suggestions!

I'm not going to dump the current control scheme, but I could add some more options. Although I kinda want to move on to my next project, I'll see about adding those in an update. I'll also take a look at the .ogg format, thank you. :)

You can use http://media.io/ to convert the files. Then you just have to change .wav to .ogg in the code :p

It will reduce the size a lot.

Looks good! For what I saw, you'd benefit from having a grid and a "snap to grid" function.
Assets are really nice, too 8)

General / Re: sfml 2.0 undefined reference to getDefaultFont
« on: April 26, 2013, 08:57:23 pm »
That's because when you call sf::Text text("hello"); it interprents it as  sf::Text text("hello", Font::getDefaultFont(), 30); whereas if you call it with the defualt constructor, it doesn't.

Basically you can do this:
sf::Text myText;

or this:
sf::Text myText("Blah", myFont, 30);

PS: you can ommit the 30 as, BUT you can't ommit the font, because it calls defaultFont, which doesn't exist anymore

More info: http://www.sfml-dev.org/documentation/2.0/classsf_1_1Text.php

I am not really sure, but I think that tutorial uses SFML 1.6, which is an outdated version and you SHOULD NOT USE IT. Again, I'm not really sure, but just in case ;)

SFML projects / Re: Platform - The simple platformer game
« on: April 24, 2013, 03:23:09 am »
I realized that was a poor explanation, what I do is this: I have the sprite sheet.png (you can view this in "recursos/imagenes" folder) and I load it on Tiled. I use Tiled to create the map, and then export it to .txt. Afterwards, I delete some things (like headers for example) that are present on the exported .txt, but I don't want and therefore my custom loader doesn't recognize.

The tiles(rectangleShape) are loaded (tile size is dependant of the game resolution) one by one, and then I apply the correspondent sf::Texture to each. Actually, it's the same texture (the sprite sheet) but rectanlgeShape has a method (setTextureRect) that lets me grab only a portion of the sprite sheet.

Unfortunately, there's a bug (I think it's related to the sf::view, and not the sf::rectangleShape) where one line of pixels will load wrong, and so you end up with a line of wrong pixels on your texture. This is a known issue and they will fix it (I hope) for SFML 2.X. In other words, won't be fixed for SFML 2.0

Or, for example, instead of making a full RPG, start with the battles. I'm guessing you wanted to make a turn based RPG.

You can pick the mage, the soldier and the archer (for example) and you can pick your opponents (rats, skeletons, or maybe even a dragon) and you fight. The usual: player action, do the math for the HP lost (maybe even use the "miss", and "critical"), then the AI.

And there's where it gets tricky. A good AI can do wonders for your game, whereas a bad AI will probably kill the whole project. Will the dragon attack? Will he use his turn to recover MP and so the next turn he can use his "Breath fire" spell? Will he kill the mage, or maybe cripple (cripple as a status effect, where maybe he can only land half of his hits) the soldier if he's the main character.

And honestly, there are tons of things you can add later. To be honest, while I'm writing this I'm imagining how MY RPG would be like. I love advance wars and fire emblem series, tactical turn based RPG me likes.

To conclude, don't be frightened because of a big project, divide it in sizable chunks and then eat them one by one. :)

SFML projects / Re: Platform - The simple platformer game
« on: April 23, 2013, 07:56:09 pm »
I'm glad you liked them ;D

I use Tiled to help me, but I am using a custom loader, as I don't need most of the stuff Tiled gives.

SFML projects / Re: Platform - The simple platformer game
« on: April 21, 2013, 10:26:51 pm »
I'm glad you liked it ;D

New version! 1.0 RC
The Whole game(12MB only windows): http://www.mediafire.com/?4db266hs684whma
Update from 0.9 to 1.0 RC(448KB): http://www.mediafire.com/?5o5xdw2co3yul81

What's new?
Five new levels! (What goes up... set)
Improved the settings saver/loader.
You can now choose to show or hide the FPS.
Accent support (á, é, ö, etc).
German translation! (Thanks AlexAUT)
Small changes to the existing levels (to make them more fair)
Lots of change behind curtains, such as elminating all the "using namespace sf", and making everything more efficient.

As always, enjoy! :)

Pages: 1 ... 3 4 [5] 6 7 8