Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Problem when I rotate a sprite

Author
Message
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 3rd Aug 2010 22:29
Hi, I want to set my camera to an image, I set a sprite from the image, and when I rotate it the sprite is not refreshed ...

Can you help me please ? Thanks




Eternal suffering ...

I'm french
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 3rd Aug 2010 23:00
I've found, I forgot the offset sprite ...

Eternal suffering ...

I'm french
Sepnon
16
Years of Service
User Offline
Joined: 7th Feb 2010
Location: Brazil
Posted: 3rd Aug 2010 23:01 Edited at: 3rd Aug 2010 23:02
trying to rotate the camera will make it look wierd, because of the camera aspect (difference between width/height res)

1: You're offseting the sprite to the center, so the position should be:

Quote: "sprite 125,Screen Width()/2,Screen Height()/2,125"


2: The sprite is rotated 90 degrees, so when you resize the sprite, it should be:

Quote: "size sprite 125,screen height(),screen width()"


2 is the problem: the aspect
everything will look distorted horizontally.
To fix this, use the command "set camera aspect", with the screen width / screen height. Look this example:




EDIT: LOL, never tryed rotating the view.. cool!
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 3rd Aug 2010 23:55
Thanks ^^

I use the sprite because I've problem with axis (I climb on the walls ^^)

Eternal suffering ...

I'm french
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 4th Aug 2010 00:22
Hum, as I think at this, do you know how to switch properly to my camera after a "set camera to image" ?


Thanks

Eternal suffering ...

I'm french
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 6th Aug 2010 15:23 Edited at: 6th Aug 2010 15:24
Something like SET ACTIVE CAMERA...? Or do you mean, you can't get the camera image to be put on the screen? If you set the active camera to an image, the screen will not update on it's own, you have to PASTE IMAGE.

The fastest code is the code never written.
Hell_666
17
Years of Service
User Offline
Joined: 11th Jul 2009
Location: France
Posted: 7th Aug 2010 20:25
No, I get the image, it's not the problem, but when I switch to my camera with "set current camera" after I deleted the image, my camera is dark ^^

It's not a problem, I've a solution


Thanks

Eternal suffering ...

I'm french

Login to post a reply

Server time is: 2026-07-25 07:37:29
Your offset time is: 2026-07-25 07:37:29