Cullen D'Avello
@CullenDAvello
Ok so, (I’m using SFML) I have (had) set up a Texture texture; if (!texture.loadFromFIle(“texture.json”)) and I had the sprite code but when I wentpolygott
SPQR I can't really do it for you without knowing exactly what you're trying to accomplish, maybe try re-adding your Sprite so we can help you fix the errors and show you what you did wrong?
Also I have some projects of my own i'm currently working on but i can certainly help you out here and there :)3 years ago
OK I've been making a game for a little bit, lots of rectangles not many patterns so I've finally decided to use a tile set but i don't know how can a
SPQR Hello,
Sorry for the (very) late response, I've been out of state and thus away from my computer for about a week and a half.
@mwilki7 did a really good job of explaining this, and there isn't really much else to be said. If you end up needing anything else, though, just @ me. :)3 years ago
mwilki7 It will take a bit of time nailing all the coordinates for your tileset but once you find all the coordinates it shouldn't be a problem.
After taking a look at the documentation, you should be able to use your tileset by:
loading the texture
convert from texture to sprite
sizing the sprite
drawing the sprite
Declared variables:
sf::Texture texture;
RenderWindow window(...);
For loading:
if (!texture.loadFromFile("image.png"))
{
// error...
}
For converting:
sf::Sprite sprite;
sprite.se4 years ago
hey @SPQR can you help me with on screen text the SFML website says the code i have on lines 87-91 is right but it says "font" is undeclared even thou
abc3354 Hi !
This question was answered but I drop a tutorial link for anyone else ;)
https://www.sfml-dev.org/tutorials/2.5/graphics-text.php4 years ago
SPQR So, you have to use the built-in fonts that come with xterm, change times new roman to one of the fonts in the x font directory. I used "/usr/share/fonts/X11/misc/ter-u16b_iso-8859-1.pcf.gz"4 years ago
@SPQR hey, i started using SFML because SDL didn't get me anywhere and you were right SFML is way easier, but i keep getting this unqualified-id erro
SPQR Basically, you have a problem with your brackets. If you delete a few of the lines with extraneous brackets that should help. Also, there's some other problems with parentheses that i fixed for you. Also Also, not sure what you're doing with the "collision" namespace. Did you mean to use a class or struct? Also Also Also, you have window.setFramerateLimit(60); outside of int main(). You need to run functions inside of other functions, this is fixed by simply moving it inside the brackets.
That4 years ago
i have been made aware that using the SDL api is a lot easier than normal c code and i was wondering if there is a way to use it on repl. i have all o
SPQR https://repl.it/@SPQR/SDLtest made this a while back as a proof of concept. Like @theangryepicbanana said, though, SDL_image doesn't work yet, so I'd recommend using SFML instead, which I have working at https://repl.it/@SPQR/SFML. SFML is (in my humble opinion) easier to learn and use anyways and for a beginner (which I assume you are) is the more viable choice imo.4 years ago