Components Communicate with GUIControl
by kinleong · in Torque X 2D · 07/18/2009 (2:22 am) · 2 replies
Hi all,
Here is my situation. I have a T2DSceneObject with T2dCollisionComponent. I have delegate a method for the OnCollision. It is a small sparking particle effect. Now, I added a GUIControl to the screen which is a GUIBitmap. I would like to change the picture of the GUIBitmap during the T2dSceneObject is collided. How can I achieve it? Thanks a lot.
Here is my situation. I have a T2DSceneObject with T2dCollisionComponent. I have delegate a method for the OnCollision. It is a small sparking particle effect. Now, I added a GUIControl to the screen which is a GUIBitmap. I would like to change the picture of the GUIBitmap during the T2dSceneObject is collided. How can I achieve it? Thanks a lot.
Torque Owner Jason Cahill
Default Studio Name
GUIBitmap gb = TorqueObjectDatabase.Instance.FindObject<GUIBitmap>("myBitmapObject"); gb.Bitmap = @"data\images\nameOfImageToRender";Ensure that you have the image in your Game\data\images folder and as included in the Content for your game.
Let me know if this doesn't work for you.