Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: 2D In Irrlicht...wtf?  (Read 997 times)

0 Members and 1 Guest are viewing this topic.
2D In Irrlicht...wtf?
« on: February 18, 2007, 11:43:58 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Okay, I can load a texture etc. in irrlicht, but when I try to load the image it always seems to come out wierd.

Say the irr::core::rect<s32> nBox = (0,0,7,7), and the image is an 8*8 image, the image displayed would have parts 'cut-off'. So, I thought "Okay, I'll try this!": irr::core::rect<s32> nBox = (1,1,8,8)

Same result. Okay, WTF? I try some other stuff, and eventually pull out my hair, punch the wall, and come here for help. So, anyone know what co-ordinates I would have to enter to load a part of an image.

E.G I have an image represented by these numbers

0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 1 0 0 0 0
0 0 1 1 1 1 0 0 0 0
0 0 1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0

And I want to load only the Box made from 1's from the image. What would I have to set the rect<s32> to, in order to do this?

Sorry if this doesn't make sense, I'm not quite sure how to explain it.
Logged
Re: 2D In Irrlicht...wtf?
« Reply #1 on: February 19, 2007, 11:12:20 am »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
I've solved it, but it's really wierd.

The box has to be altered to be loaded like this 0_o This is compared to the co-ordinates show in paint (starting at 0,0)
same, -1, +1, same.


It's strange...anyone know why it's like this?
« Last Edit: February 19, 2007, 11:22:26 am by TheDarkJay »
Logged
Re: 2D In Irrlicht...wtf?
« Reply #2 on: February 19, 2007, 01:03:06 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
If the origin of the image is 0,0 then you would want to use the 1, 2, 3, 5 as the rectangle.
Logged
Re: 2D In Irrlicht...wtf?
« Reply #3 on: February 19, 2007, 02:38:34 pm »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
Okay.

Anyway, I've managed to get things working, :D

Using this small Tilesheet I've managed to get things drawing right XD




The trees and flower etc. are another layer to the grass etc, allowing me to have transparency between the two. I stole these from here and there for testing purposes (read: googled). Credit to whoever made/ripped em XD

So...yeah...all is sorted...no more posts in this topic...
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.085 seconds with 45 queries.

anything