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

Pages: [1] 2
1
SFML projects / Re: 'Tiled' Tile-map Loader
« on: October 22, 2013, 09:41:02 pm »
Works like a charm!

A bit more laggy than I hoped but then again 16x16 sprites are quite tiny. That and I'm multitasking while playing a game anyway.

Thanks so much!

2
SFML projects / Re: 'Tiled' Tile-map Loader
« on: October 22, 2013, 09:38:39 pm »
Thanks, the Minecraft.png was indeed in the same folder. I changed the <image source> bit but no luck, still gives me exactly the same error.

This is so weird.

edit: lemme try the tmx thing

3
SFML projects / Re: 'Tiled' Tile-map Loader
« on: October 22, 2013, 09:24:48 pm »
erk. Can you provide me with a map / tileset that causes this?

Here we go.

4
SFML projects / Re: 'Tiled' Tile-map Loader
« on: October 22, 2013, 09:07:15 pm »
As stated, you access std::vector element past its size.

So my map is too big?

I have no idea what it means.

5
SFML projects / Re: 'Tiled' Tile-map Loader
« on: October 22, 2013, 08:56:23 pm »
Whaaaat went wrong here?



Using SFML 2.1.
Any idea what could have caused this?
It compiled fine.

6
Graphics / Re: How do I get mouse position relative to a sprite?
« on: October 14, 2013, 08:17:09 pm »
Either convert the world coordinates to pixel coordinates or the other way around. The functions you'll be interested in are: window.mapPixelToCoords or window.mapCoordsToPixel
For further details look at the view tutorial and the documentation. :)

Cool! Just what I was looking for, I think.
Now to figure out how to use this.

Edit: thank you! It works perfectly!

7
Graphics / Re: How do I get mouse position relative to a sprite?
« on: October 14, 2013, 07:59:41 pm »
Subtract the sprite's position from the mouse position?

(If your sprite is rotated or scaled, take into account its whole transform.)

But that would require sprite position relative to the window. My sprites have their position relative to the world. :\

8
Graphics / How do I get mouse position relative to a sprite?
« on: October 14, 2013, 06:50:46 pm »
I'm using mouse position relative to center of the screen, but I found that for my project it would be far more useful to use mouse position relative to a sprite.

How do I do this?

9
Window / Re: Windows gains focus only at borded
« on: August 24, 2013, 08:28:37 pm »
I fixed my fix :>


10
Window / Re: Windows gains focus only at borded
« on: August 24, 2013, 08:12:07 pm »
Not really a fix, he displays "click border to focus" with a lame rant in the lower right corner. ;)
Yeah, he should instead move to some 'lame' library that actually has fully working input handling instead of saying the 'lame' truth that a bug was introduced in one of basic pieces of SFML. :-\
Hey now I love this library as much as the next guy, don't judge me for my bad jokes :(

11
Window / Re: Windows gains focus only at borded
« on: August 24, 2013, 07:08:37 pm »
Edit: I fixed it.
Do you mind sharing what you've done to "fix it"? :)
Ah, yes of course.

Basically I've got my event checker looking for the LostFocus event, which switches the 'IsFocused' bool to false. It also switched the gamestate to the pause menu and disables the pause menu's events.
Then later on in the code when I render everything I have my code see if 'IsFocused' is false; if it's false it will display 'Click window border to focus'.
When you regain focus the overlay is removed and it puts the pause menu back in order, from here you're free to continue whatever you were doing.


Not really a fix, he displays "click border to focus" with a lame rant in the lower right corner. ;)

All in good fun  ;)

12
Window / Re: Windows gains focus only at borded
« on: August 24, 2013, 05:38:24 pm »
Came here to report this actually, it's bugging.

Is there a workaround?
Edit: I fixed it.


13
There's no difference, really. Except in your code: when you choose "Windows" your entry point must be WinMain instead of main. If you don't want to define it, and keep a portable code, you can link to sfml-main instead.

Thank you! It works perfectly. :D

14
Quote
Then, how did I have a console window in my Debug Version while I didn't have one in the release version?
Project settings > Linker > System > Sub-system. You had it to "Console" in Debug and "Windows" in Release.

Exactly!

And (as sated in my original post) that worked in vc2010!

In vc2012 it threw my this:
Quote
1>MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
1>I:\xzbobzx\Bobstudios\Projects\Western Game\WesternGame\Release\WesternGame.exe : fatal error LNK1120: 1 unresolved externals

15
Either way, I read the tutorial again, and I followed your advice, tried it, but the console window still wouldn't budge. My project is a Console Application, not a Windows Application, so in the end WinMain isn't even of importance.

I don't understand why the console window went away so easily in vc2010 and not in vc2012 even though both projects were console applications. :\

If you choose console as your application type you will always get the console window. This is no different for VS 2010 - so you must not be remembering that you had it set to window application to hide the console.

Then, how did I have a console window in my Debug Version while I didn't have one in the release version?  :-\

I understand what you're trying to say but I know what I did, and I don't understand how it worked the way it did either.

Pages: [1] 2