OnLashoc
Member
I've been racking my brain on this and for some reason I just can't get anything to work. The closest I've come was by downloading a market addon, but even then click on a separate object wouldnt change the text nor destroy text.
Im sure there is an easier way bu I just havent figured it out. So basically I have a couple images representing different races, each image is a separate object. You click on a race and the text object displays a little information about that race.. Upon clicking on another race, the text object needs to be destroyed and replaced with a different text object containing the background info for the new race you clicked on.
I tried several other methods to try and accomplish this but nothing has quite worked. Any suggestions?
This code has worked to accomplish this with objects that have an image, and no text on the DRAW event. But text? hell no it wont destroy the text object.
Another example that is actually working.
This code basically destroys the oBlankf object and subsequent code replaces that object with a different flag object
But when the object has no image and contains only a text string to draw, it will not instance_destroy the text object.
Something with having the text drawn is causing it to remain regardless of how I try to change that text upon clicking a different race. I'm almost to the point of creating an image in photoshop of the text, but only want to do that as a last resort.
Im sure there is an easier way bu I just havent figured it out. So basically I have a couple images representing different races, each image is a separate object. You click on a race and the text object displays a little information about that race.. Upon clicking on another race, the text object needs to be destroyed and replaced with a different text object containing the background info for the new race you clicked on.
I tried several other methods to try and accomplish this but nothing has quite worked. Any suggestions?
This code has worked to accomplish this with objects that have an image, and no text on the DRAW event. But text? hell no it wont destroy the text object.
Code:
if mouse_check_button_pressed(mb_left) && instance_exists(oTribeinfobox){
if collision_point(mouse_x, mouse_y, oETaman, true, false)
{
}
Code:
if mouse_check_button_pressed(mb_left) && instance_exists(oBlankf) {
if collision_point(mouse_x, mouse_y, oColorgrey, true, false)
{
instance_destroy(oBlankf);
instance_create_layer(oTribeselect.x+730,oTribeselect.y+430,"Banner",oGflag);
}
}
else
{
if mouse_check_button_pressed(mb_left) && instance_exists(oRflag) {
if collision_point(mouse_x, mouse_y, oColorgrey, true, false)
{
instance_destroy(oRflag);
instance_create_layer(oTribeselect.x+730,oTribeselect.y+430,"Banner",oGflag);
}
}
But when the object has no image and contains only a text string to draw, it will not instance_destroy the text object.
Something with having the text drawn is causing it to remain regardless of how I try to change that text upon clicking a different race. I'm almost to the point of creating an image in photoshop of the text, but only want to do that as a last resort.