Heres an example(This is done by scaling the room which is not what I want to do):
Edited by demon, 25 April 2012 - 08:43 PM.
Posted 25 April 2012 - 07:23 PM
Edited by demon, 25 April 2012 - 08:43 PM.
Posted 25 April 2012 - 07:55 PM
draw_sprite_ext(sSpr,-1,x,y,1.5,1.5,60,c_white,1);
Posted 25 April 2012 - 08:05 PM
Posted 25 April 2012 - 08:09 PM
That won't work as what he wants is the sprite to maintain the angle of scaling while the texture has the rotation. You will probably need to use textured primitives for this...
Posted 25 April 2012 - 08:21 PM
d3d_transform_set_rotation_z(image_angle) d3d_transform_add_scaling(image_xscale, image_yscale, 0) d3d_transform_add_translation(x, y, 0) draw_sprite_ext(sprite_index, 0, 0, 0, 1, 1, 0, image_blend, image_alpha) d3d_transform_set_identity()Not tested, but I believe it should work. You do not have to start 3D mode to use transformation functions. The first one rotates the image, the second one scales it, and the third one moves it to the correct coordinates. The last one is needed to prevent stuff drawn afterwards from being affected by the transformation
Posted 25 April 2012 - 08:24 PM
d3d_transform_stack_push(); d3d_transform_set_rotation_z(image_angle); d3d_transform_add_scaling(image_xscale, image_yscale, 0); d3d_transform_add_translation(x, y, 0); draw_sprite_ext(sprite_index, 0, 0, 0, 1, 1, 0, image_blend, image_alpha); d3d_transform_stack_pop();
Posted 25 April 2012 - 08:25 PM
Or you can use transformations:
d3d_transform_set_rotation_z(image_angle) d3d_transform_add_scaling(image_xscale, image_yscale, 0) d3d_transform_add_translation(x, y, 0) draw_sprite_ext(sprite_index, 0, 0, 0, 1, 1, 0, image_blend, image_alpha) d3d_transform_set_identity()Not tested, but I believe it should work. You do not have to start 3D mode to use transformation functions. The first one rotates the image, the second one scales it, and the third one moves it to the correct coordinates.
Posted 25 April 2012 - 08:35 PM
Or you can use transformations:d3d_transform_set_rotation_z(image_angle) d3d_transform_add_scaling(image_xscale, image_yscale, 0) d3d_transform_add_translation(x, y, 0) draw_sprite_ext(sprite_index, 0, 0, 0, 1, 1, 0, image_blend, image_alpha) d3d_transform_set_identity()Not tested, but I believe it should work. You do not have to start 3D mode to use transformation functions. The first one rotates the image, the second one scales it, and the third one moves it to the correct coordinates.
Worked perfectly, thanks a bunch! Thats a neat little trick using D3D functions for 2D.
Edited by loverock125, 25 April 2012 - 08:35 PM.
Posted 25 April 2012 - 08:42 PM
You probably scaled it first, then rotated it. That would produce the same result as just using draw_sprite_ext
Or you can use transformations:d3d_transform_set_rotation_z(image_angle) d3d_transform_add_scaling(image_xscale, image_yscale, 0) d3d_transform_add_translation(x, y, 0) draw_sprite_ext(sprite_index, 0, 0, 0, 1, 1, 0, image_blend, image_alpha) d3d_transform_set_identity()Not tested, but I believe it should work. You do not have to start 3D mode to use transformation functions. The first one rotates the image, the second one scales it, and the third one moves it to the correct coordinates.
Worked perfectly, thanks a bunch! Thats a neat little trick using D3D functions for 2D.
I tried this before posting and it has the same result as draw_sprite_ext. Maybe I couldn't notice any difference on the texture because it was a 64x64 image.
0 members, 0 guests, 0 anonymous users