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

Author Topic: Sprite without texture  (Read 5959 times)

0 Members and 1 Guest are viewing this topic.

omariisan

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Sprite without texture
« on: January 23, 2014, 03:16:30 am »
Perhaps I missed this in the documentation, but earlier I was trying to create a Sprite without a texture. I have a GameObject object which has a Sprite object, but I want to set the texture afterwards by pulling it from a texture manager (still not sure how I'm going to implement this). However, it seems I cannot create a Sprite without a texture! Why is this so? The C++ bindings allowed this. Using None creates a giant white square...
« Last Edit: January 23, 2014, 03:20:36 am by omariisan »

math1992

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
    • Email
Re: Sprite without texture
« Reply #1 on: January 23, 2014, 03:52:28 am »
Yes, if you do not set a Texture on a sprite, it's normal that a white square is displayed.
Also, you can set the Texture before even if the texture is not created (Of course you must eventually create it before drawing the Sprite.)

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Sprite without texture
« Reply #2 on: February 03, 2014, 09:28:11 pm »
A sprite without a texture makes little sense. It shouldn't be a big deal to (re-)organize your code to ensure the texture is available before the sprite needs it.
Why do you need a non-textured sprite? And why would you want to draw it before it has a texture?

 

anything