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

Pages: [1]
1
Graphics / Re: Objects using wrong textures
« on: April 07, 2014, 03:38:57 am »
This is the code for creating the custom mouse (in the main() function):
http://pastebin.com/6bVRMXiQ

This is the Wall class:
http://pastebin.com/NQDVPLHM

And this is in my main function where I create each wall:
http://pastebin.com/LdGrXZ85

2
Graphics / Objects using wrong textures
« on: April 07, 2014, 12:28:03 am »
So I'm learning SFML, and in my game I've created a platform object, with its own sprite and texture. The texture is simply a grey square.
In my main() function, I call window.setMouseVisible(false) and create a new sprite to use as a custom cursor. The cursor texture is a black circle with a dot in it.
Now when I create some platforms in my code, then run the program, all of the platforms use the cursor texture, scaled up to the size of their original texture. It seems for some reason, the platform objects are taking the texture of the cursor. I've tried removing the cursor texture, but then the platforms have no textures, they're just white squares.
Any reason for this? It sounds like the platform textures are going out of scope, but unless I've forgotten all of my programming lessons, I don't think that's the case. And even if they were, why would they be taking the cursor's texture?

Pages: [1]
anything