mharezlak96
08-11-2010 16:45:05
Hi. How I can use 2D images (.jpg) in my game? I'd like make a main manu, I have strings, but I 'd like have background in main menu. How I can use images?
mharezlak96
08-11-2010 16:45:05
ianhfar
09-11-2010 09:52:07
BillboardSet mJpgSet = sceneMgr.CreateBillboardSet("JpgsEx");
mJpgSet.SetMaterialName("YOUR MATERIAL HERE");
mJpgSet.CullIndividually = true;
mJpgSet.QueryFlags = 0; // They should not be detected by rays.
mNode.AttachObject(mJpgSet);
// where mNode is your SceneNode you want to attach to, could be your default main node the camera is attached to.
// -------------------------------
// Creation of the billboards
// -------------------------------
Billboard Picture = mJpgSet.CreateBillboard(0, 0, 120);
Picture.SetDimensions(10, 10);
mharezlak96
09-11-2010 16:13:58
BillboardSet mJpgSet = Engine.Singleton.SceneManager.CreateBillboardSet("JpgsEx");
mJpgSet.SetMaterialName("Vase/TEXFACE/vase.jpg");
mJpgSet.CullIndividually = true;
mJpgSet.QueryFlags = 0; // They should not be detected by rays.
SceneNode mNode = new SceneNode(Engine.Singleton.SceneManager);
// where mNode is your SceneNode you want to attach to, could be your default main node the camera is attached to.
// -------------------------------
// Creation of the billboards
// -------------------------------
Billboard Picture = mJpgSet.CreateBillboard(2, 2, 2);
Picture.SetDimensions(10, 10);
issingle
10-11-2010 01:08:56
mharezlak96
10-11-2010 13:11:48
ianhfar
10-11-2010 14:47:01
mJpgSet.SetMaterialName("Vase_Texface"); // Material name NOT jpg file
mNode.AttachObject(mJpgSet); // this line seems to be missing in your code, plus ensure you have a scenemanager and camera set up!
material Vase_Texface
{
technique
{
pass
{
texture_unit
{
//texture "vase.jpg"
texture "Your Jpg name.jpg"
}
}
}
}
mharezlak96
13-11-2010 12:50:15