Magic Library - True Type windows font
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
New_x_Pos=x_pos-((strlen(text)*charLength)/2)
where
charLength = the second Parameter in CreateFont function.
this will position the text as you want.
where
charLength = the second Parameter in CreateFont function.
this will position the text as you want.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
First: sorry for all these questions and for my poor English
I want to know more about the CheckCollide functions:
CheckCollide ( grp_actual_sprite , My_Player.pos_x , My_Player.pos_y , grp_ball , ball.pos_x , ball.pos_y ,1,0)
1) What are the last two parameters?
2) This function check the collide in what mode? pixel by pixel?
3) If not, how can I check a collision between 2 sprites drawed with the alpha method? (alpha key: leaving the background color..)
(I want to check the collision by the SHOES of a soccerplayer and the BALL... I've thinked to separate the shoes sprites by the rest of the body and check the collision with the ball)
I want to know more about the CheckCollide functions:
CheckCollide ( grp_actual_sprite , My_Player.pos_x , My_Player.pos_y , grp_ball , ball.pos_x , ball.pos_y ,1,0)
1) What are the last two parameters?
2) This function check the collide in what mode? pixel by pixel?
3) If not, how can I check a collision between 2 sprites drawed with the alpha method? (alpha key: leaving the background color..)
(I want to check the collision by the SHOES of a soccerplayer and the BALL... I've thinked to separate the shoes sprites by the rest of the body and check the collision with the ball)
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
you are welcome any time.
the last 2 parametres are the retio in x-x and y-y, the CheckCollide function chechs the recangle by rectangle collide ,not pixle by pixle so it is more faster but we need to reduce the rectangle by retio in x-x & y-y direction that you decide to make it more real collide , 0.9 ~ 0.8 are good retio.
the last 2 parametres are the retio in x-x and y-y, the CheckCollide function chechs the recangle by rectangle collide ,not pixle by pixle so it is more faster but we need to reduce the rectangle by retio in x-x & y-y direction that you decide to make it more real collide , 0.9 ~ 0.8 are good retio.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
I've tried the CheckCollide function, but it isn't good for what I've to do.
Because I need a precisely collision between the soccer-player feets and the ball.
1) Is there any method to enable pixel by pixel collision?
2) or is there any method to check collision between only a part of a sprite? (For example I can check the collision by the down part of the soccer-player sprite, so only the feet check the collision)
Another thing:
Is there any method to color only a part of a sprite colored, for example, by white?
I need it to color the shirt of soccer-player of various colors.
Be patience!
Because I need a precisely collision between the soccer-player feets and the ball.
1) Is there any method to enable pixel by pixel collision?
2) or is there any method to check collision between only a part of a sprite? (For example I can check the collision by the down part of the soccer-player sprite, so only the feet check the collision)
Another thing:
Is there any method to color only a part of a sprite colored, for example, by white?
I need it to color the shirt of soccer-player of various colors.
Be patience!
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
i have a selution that may feet your needs.
if you are using Magic2d ver 0.8 ,there is a TMagicSceneNode class, so you could use 2 TMagicSceneNodes to shape your sprite { one for upper part and the other for the feet }, and make the upper as a parent of feet one,then you could only check Collision between the feet and the ball,when the upper part move the feet will move automatically.
if you are using Magic2d ver 0.8 ,there is a TMagicSceneNode class, so you could use 2 TMagicSceneNodes to shape your sprite { one for upper part and the other for the feet }, and make the upper as a parent of feet one,then you could only check Collision between the feet and the ball,when the upper part move the feet will move automatically.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
Even this solution doesn't go fine...
Because the TMagicSceneNode it's only a single sprite,
while I need animations (more sprites, like TAnimImage).
However, I need different sprites only for feet, because I want to color them by code (How can I do it? You haven't answered me for that )
PS:
Isn't there any possibility to include pixel by pixel collision?
or other check type collision?
Because the TMagicSceneNode it's only a single sprite,
while I need animations (more sprites, like TAnimImage).
However, I need different sprites only for feet, because I want to color them by code (How can I do it? You haven't answered me for that )
PS:
Isn't there any possibility to include pixel by pixel collision?
or other check type collision?
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
ok,i will Make TAnimImageSceneNode next release,but for now, i am thinking in spliting our player sprite into 3part {i mean the 2D Image splits into 3 Part}, one for head ,one for deffrent color body , and finaly one for feet.
BTW any part can be TAnimImage for your desired animation , it will depend on yore artist skill to collect the sprite in good image.
so how could we move the 3 parts in the same time and color any certain part ?
we can do it by relative coordinates just like that
draw Part_1 at (P1_x , P1_Y)
draw part_2 at (P1_x + P2_const_x,p1_y + P2_const_y)
draw Paer_3 at (P1_x + P3_const_x,p1_y + P3_const_y)
so you need only to update P1_x & P1_Y.
when you draw part_2 you could change it's color by setColor function.
i do not know how to do pixel by pixel collision,but i will search the net for best and fast algorithem and see if i can apply it or not.
Hope that will help you.
BTW any part can be TAnimImage for your desired animation , it will depend on yore artist skill to collect the sprite in good image.
so how could we move the 3 parts in the same time and color any certain part ?
we can do it by relative coordinates just like that
draw Part_1 at (P1_x , P1_Y)
draw part_2 at (P1_x + P2_const_x,p1_y + P2_const_y)
draw Paer_3 at (P1_x + P3_const_x,p1_y + P3_const_y)
so you need only to update P1_x & P1_Y.
when you draw part_2 you could change it's color by setColor function.
i do not know how to do pixel by pixel collision,but i will search the net for best and fast algorithem and see if i can apply it or not.
Hope that will help you.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
you could put the 3 times drawing in a isolated function and when you want to draw call this function.
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
last question for today :
I have to load a high number of sprites (I want to make the player much personalizable).
But I've tested that for each file (containing the sprites) I load, it takes a while...
What can I do?
My sprites were .BMP images.
I've tried to convert them to .PNG : I've the same results with less memory space, but with the program it's always the same: much time to load it!
I have to load a high number of sprites (I want to make the player much personalizable).
But I've tested that for each file (containing the sprites) I load, it takes a while...
What can I do?
My sprites were .BMP images.
I've tried to convert them to .PNG : I've the same results with less memory space, but with the program it's always the same: much time to load it!
-
- Posts: 518
- Joined: Tue Mar 29, 2005 9:02 pm
- Location: Alex,Egypt
- Contact:
last answer for today
this belong to Irrlicht it self,so i do not know how to solve this case
this belong to Irrlicht it self,so i do not know how to solve this case
Magic 2d Library For Irrlicht : http://www.freewebs.com/bcxgl/index.htm
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/
http://www.freewebs.com/bcxdx/index.htm
http://groups.yahoo.com/group/bcxdxc/