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

Author Topic: Set Size of Texture  (Read 3734 times)

0 Members and 1 Guest are viewing this topic.

Jalfor

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Set Size of Texture
« on: October 03, 2012, 12:31:35 pm »
Hi,

Is there any way of creating or resizing a texture to a certain size. I know there is the scale function though that multiplies the size by the given amount instead of setting it to something.

Thanks
If a picture tells 1000 words, then a YouTube video clearly tells 1000000 making a YouTube video obviously a larger work than the Lord Of The Rings, or some other massive novel. Thus are the laws of YouTube videos.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Set Size of Texture
« Reply #1 on: October 03, 2012, 12:34:57 pm »
Do you want to resize a texture or a sprite (this is totally different)?
Laurent Gomila - SFML developer

Jalfor

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Set Size of Texture
« Reply #2 on: October 03, 2012, 02:37:48 pm »
Well, I'm not entirely sure. Whatever will simply scale up or down the size of the sprite that is drawn on the screen.
If a picture tells 1000 words, then a YouTube video clearly tells 1000000 making a YouTube video obviously a larger work than the Lord Of The Rings, or some other massive novel. Thus are the laws of YouTube videos.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Set Size of Texture
« Reply #3 on: October 03, 2012, 02:45:22 pm »
Sprite::setScale or Sprite::scale. If you want to give a size instead of a factor, then it's straight-forward to do the conversion (scale = new_size / initial_size).
Laurent Gomila - SFML developer

Jalfor

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: Set Size of Texture
« Reply #4 on: October 04, 2012, 06:56:32 am »
Alright, thanks :)
If a picture tells 1000 words, then a YouTube video clearly tells 1000000 making a YouTube video obviously a larger work than the Lord Of The Rings, or some other massive novel. Thus are the laws of YouTube videos.

 

anything