Page 1 of 1

How to make a border

Posted: Thu Dec 06, 2012 23:16
by Irene
Hi, I'm really having difficulties in understanding of how to make a border for selected inventory item from cegui inventory tutorial.

I'm adding a new item to the inventory like this:

Code: Select all

      InventoryItem& item1 = dynamic_cast<InventoryItem&>(*m_WindowManager->createWindow("TaharezLook/InventoryItem"));
      item1.setContentSize(1,1);
      m_InventoryReceiver->addItemAtLocation(item1, 1, 0);

      CEGUI::Imageset &menu_imageset = CEGUI::ImagesetManager::getSingleton().createFromImageFile("item1", "item1.jpg");
      menu_imageset.defineImage("item1.jpg",CEGUI::Point(0.0f, 0.0f),CEGUI::Size(10,10),CEGUI::Point(0.1f, 0.1f));
      item1.setProperty("Image", "set:item1 image:item1.jpg");


As i understand now I need to edit a InventoryComponents.lookandfeel.

I've added a new ImagerySection "chosen" within WidgetLook "TaharezLook/InventoryItem", and tried to edit almost everything, but nothing really gave me a border, it just shows an image or some color.

Code: Select all

<ImagerySection name="chosen">
            <ImageryComponent>
                <Area>
                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
                    <Dim type="RightEdge"><UnifiedDim scale="1" type="RightEdge" /></Dim>
                    <Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>
                </Area>
                <ImageProperty name="Image" />
                <VertFormat type="Stretched" />
                <HorzFormat type="Stretched" />
            </ImageryComponent>
         
        </ImagerySection>
<StateImagery name="ChosenItem">
            <Layer>
                <Section section="chosen" />
             </Layer>
        </StateImagery>


Help?