Tiling image issue

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

06casswp
Just popping in
Just popping in
Posts: 7
Joined: Wed May 04, 2011 15:24

Tiling image issue

Postby 06casswp » Thu Mar 29, 2012 05:58

Hi guys

Having a slight issue getting tiling to work as I understand it. I am trying to create a set of grid lines through the use of tiled 50% transparent png's that regularly tiles the screen at a fixed size per tile (native resolution). To do this I have added a new widget to the Vanillalook theme by copy pasting the staticimage widget code, renaming it staticimage1 and adding to the scheme file. I have so far made a couple of changes, to:

Code: Select all

<PropertyDefinition name="VertFormatting" initialValue="Tiled" redrawOnWrite="true" /> //setting both to tiled instead of stretched
        <PropertyDefinition name="HorzFormatting" initialValue="Tiled" redrawOnWrite="true" />
and I have changed the:
                <VertFormatProperty type="Tiled" /> //from name= vertformatting
                <HorzFormatProperty type="Tiled" />

for both imagery components.

I am creating using code and not layout files and this is all the relevent code:

Code: Select all

   Semi = _wmgr->createWindow("Vanilla/StaticImage1", "Semi");
   CEGUI::Imageset* IMS = &CEGUI::ImagesetManager::getSingleton().createFromImageFile("Semiimage","menuSemi.png","Imagesets");
   IMS->setAutoScalingEnabled(false);
   Semi->setProperty("Image","set:Semiimage image:full_image");
   Semi->setSize(CEGUI::UVector2(CEGUI::UDim(0.0f, 100), CEGUI::UDim(0.0f, 100)));
   Semi->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim( 0.0f)));
   sheet->addChildWindow(Semi);
   Semi->setVisible(false);


I set to visible later when its needed.

The result is a single copy of the tile. (top left) Without setting autoscaling on the imageset, it is stretched to fit the smallest dimension and the other is clipped. Ie maintains aspect ratio.

Image

Uploaded with ImageShack.us - http://imageshack.us/photo/my-images/16 ... 216450.jpg

Am i correct in assuming that setting formatting will automatically create multiple tiles to fill the area set by Semi?

Thanks for help. Theres no issues in the log file that i can see.

Code: Select all

29/03/2012 16:44:53 (Std)    ---- Version 0.7.6 (Build: Apr 15 2011 Debug Microsoft Windows MSVC++ 10.0 32 bit) ----
29/03/2012 16:44:53 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
29/03/2012 16:44:53 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
29/03/2012 16:44:53 (Std)    ---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
29/03/2012 16:44:53 (Std)    ---- Scripting module is: None ----

Edit: I also know about the performance hit, i'm doing it for educational and support of unlimited resolution reasons. I will likely have it tile at 1920x1080 when its working. Have had a good look through the forums/documentation as well.

Edit by Kulik: Added code sections to avoid eye pain.

Return to “Help”

Who is online

Users browsing this forum: No registered users and 15 guests