CEImagesetEditor: Problems setting width and/or height

Use this forum for:
- Discussion regarding unofficial CEGUI related tools, scripts and utilities.
- User to user help for the obsoleted CELayoutEditor and CEImagesetEditor tools.

Moderators: CEGUI MVP, CEGUI Team

ppl
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue May 15, 2007 16:37
Location: Canada

CEImagesetEditor: Problems setting width and/or height

Postby ppl » Tue Jun 12, 2007 17:53

Hello,

Sometimes I'm editing an imageset and I'm unable to specify a certain width or height. CEImagesetEditor will round up my input.

Imho, this is a bug. I should be able to specify my width/height in pixels. Anyone else having similar issues?

ppl
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue May 15, 2007 16:37
Location: Canada

Postby ppl » Thu Jun 14, 2007 13:08

The following fix my problem.

Code: Select all

void EditorGLCanvas::addRegion( const wxString& name, const wxRect& dim )
{
    ElasticBox* toolbox = static_cast<ElasticBox*>(
        WindowManager::getSingleton().createWindow( "CEImagesetEditor/ImageRegion", CEGUIHelper::ToCEGUIString( name ) ) );

#if 0
    float posx = 0, posy = 0, width = 0, height = 0;

    if  ( ( m_realWidth != 0 ) && ( m_realHeight != 0) )
    {
        posx = static_cast<float>( dim.GetX() ) / m_realWidth;
        posy = static_cast<float>( dim.GetY() ) / m_realHeight;
        width = static_cast<float>( dim.GetWidth() ) / m_realWidth;
        height = static_cast<float>( dim.GetHeight() ) / m_realHeight;
    }
    // set size and position (all relative co-ords)
    toolbox->setPosition( UVector2( UDim( posx, 0.0f ), UDim( posy, 0.0f ) ) );
    toolbox->setSize( UVector2( UDim( width, 0.0f ), UDim( height, 0.0f ) ) );
#endif

    toolbox->setPosition( UVector2( UDim( 0, dim.GetX() ), UDim( 0, dim.GetY() ) ) );
    toolbox->setSize( UVector2( UDim( 0, dim.GetWidth() ), UDim( 0, dim.GetHeight() ) ) );

        .
        .
        .



Imho, in the imageset editor, it doesn't make sense to use scalling. It should always be an offset since we are dealing with an image in pixels. I prefer to use an offset.

I also don't understand why the offset portion of a UVec2 is not an integer value.

Anyone can shed some light on these issues?

Thanks,
ppl


Return to “Unofficial CEGUI-Related Tools”

Who is online

Users browsing this forum: No registered users and 6 guests