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

Author Topic: Sprites not the correct size?  (Read 2630 times)

0 Members and 1 Guest are viewing this topic.

Drak

  • Newbie
  • *
  • Posts: 8
    • View Profile
Sprites not the correct size?
« on: May 24, 2011, 01:56:06 am »
I have a window (800x600) and I render a box sprite that's 32 x 32 (.png format). It looks like this: (the teal cube)
http://i53.tinypic.com/21o206r.png

Obviously, it's being stretched or something similar, as it's not the correct dimensions. Does this have todo with my resolution? Why is it not appearing like it should? Thanks.

David

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Sprites not the correct size?
« Reply #1 on: May 24, 2011, 02:09:14 am »
Try this:

Code: [Select]
Image.SetScale(32, 32);

Of course, you can always draw a shape, unless the box in your example is just a placeholder for an image

Drak

  • Newbie
  • *
  • Posts: 8
    • View Profile
Sprites not the correct size?
« Reply #2 on: May 24, 2011, 02:17:38 am »
Quote from: "David"
Try this:

Code: [Select]
Image.SetScale(32, 32);

Of course, you can always draw a shape, unless the box in your example is just a placeholder for an image

It's just a place holder. I'm not sure why, but after calling that function, this happened:
http://i51.tinypic.com/15x0cnt.png

David

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Sprites not the correct size?
« Reply #3 on: May 24, 2011, 02:23:55 am »
Jaja, sorry, but I can't look at pictures on image shack (I'm on my school computer  :cry: ) so you'll have to describe it to me  :(

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Sprites not the correct size?
« Reply #4 on: May 24, 2011, 04:48:27 am »
Quote from: "Drak"
Quote from: "David"
Try this:

Code: [Select]
Image.SetScale(32, 32);

Of course, you can always draw a shape, unless the box in your example is just a placeholder for an image

It's just a place holder. I'm not sure why, but after calling that function, this happened:
http://i51.tinypic.com/15x0cnt.png
That's what's supposed to happen. You're setting it to scale the image so that it's 32 times wider and 32 times taller. Try Resize(32, 32) instead.
I use the latest build of SFML2

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Sprites not the correct size?
« Reply #5 on: May 24, 2011, 04:48:59 am »
Quote from: "David"
Jaja, sorry, but I can't look at pictures on image shack (I'm on my school computer  :cry: ) so you'll have to describe it to me  :(
He's not using ImageShack. He's using TinyPic.
I use the latest build of SFML2

David

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Sprites not the correct size?
« Reply #6 on: May 24, 2011, 11:56:30 pm »
Whatever, it's still blocked

And I meant Resize(32, 32). So sorry  :oops: