static image scaling

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Protagonist
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Sat Mar 03, 2007 22:54

static image scaling

Postby Protagonist » Thu Mar 15, 2007 23:49

Hi there, I've created my static image as follows:

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 :)

Return to “Help”

Who is online

Users browsing this forum: No registered users and 28 guests