Code: Select all
//create the static image
CEGUI::Window* waterlineMarker = winMgr.createWindow("WindowsLook/StaticImage", "Root/WaterlineMarker"); //create widget
mGUISheet->addChildWindow(waterlineMarker);
waterlineMarker->setProperty("FrameEnabled", "false");
waterlineMarker->setProperty("BackgroundEnabled", "false");
waterlineMarker->setPosition(CEGUI::UVector2(CEGUI::UDim(0.25, 0), CEGUI::UDim(0.5, 0)));
waterlineMarker->setSize(CEGUI::UVector2(CEGUI::UDim(0.5, 0), CEGUI::UDim(0, 3))); //scale, offset - offset in pixels
//create the texture
//Texture* texturePtr = System::getSingletonPtr()->getRenderer()->createTexture("ImageFile.jpg");
CEGUI::Texture* dash = mGUIRenderer->createTexture("../../media/materials/textures/dash2.tga"); //full path and name from working dir
//load texture into CEGUI imageset
CEGUI::Imageset* markerImageSet = CEGUI::ImagesetManager::getSingleton().createImageset("Markers", dash); //imageName, texturePtr
markerImageSet->defineImage( "dash", CEGUI::Point(0.0f, 0.0f), CEGUI::Size(40, 5), CEGUI::Point(0.0f, 0.0f) );
//markerImageSet->setAutoScalingEnabled(true); //d_horzScaling
//load imageset into static image waterlineMarker
waterlineMarker->setProperty( "Image", "set:Markers image:dash"); //default is full_image, use that if use quick texture and imageset making line
I'm trying to make a dashed line you see. I have an image with the alpha working, but it stretches to fit the static image widget.
I was wondering, does anybody know how I can get it to tile, to repeat to fit the width?
I'm using CEGUI 5.0
Any help would be greatly appreciated.
Thanks very much
