Esempio n. 1
0
// Read the current settings and trigger an
// update of the rendering with recompiling -- 
// this function is called whenever values change
void RenderBox::updateRendering( void )
{
        // Read the current view parameters
	if (mainForm) {
	        viewParam * vp = mainForm->getViewParam();

		// Update the view parameters
		(*vp).renderSize = getRenderSize();
		getRenderMode( vp );
		getRenderStyle( vp );
		getRenderQuality( vp );

       	 	// Send the new parameters back
	        // without requesting update
		mainForm->setViewParam( (*vp) );

		if ((*vp).enableUpdate) {

			// Re-compile the drawing lists
			mainForm->updateView();

			// Re-draw the scene
			mainForm->updateRendering();
		}
	}
}
Esempio n. 2
0
void PushButton::resizeWithText()
{
	Size size = getRenderSize();
	setSize( Absolute, size );

	Point newPos;
	newPos.d_x = m_ptHookPosition.d_x;
	newPos.d_y = m_ptHookPosition.d_y;
	switch( m_HookMode )
	{
	case Hook_Left:
		newPos.d_y -= d_pixelSize.d_height / 2;
		break;
	case Hook_Right:
		newPos.d_x -= d_pixelSize.d_width;
		newPos.d_y -= d_pixelSize.d_height / 2;
		break;
	case Hook_Top:
		newPos.d_x -= d_pixelSize.d_width / 2;
		break;
	case Hook_Bottom:
		newPos.d_x -= d_pixelSize.d_width / 2;
		newPos.d_y -= d_pixelSize.d_height;
		break;
	case Hook_LeftTop:
		break;
	case Hook_LeftBottom:
		newPos.d_y -= d_pixelSize.d_height;
		break;
	case Hook_RightTop:
		newPos.d_x -= d_pixelSize.d_width;
		break;
	case Hook_RightBottom:
		newPos.d_x -= d_pixelSize.d_width;
		newPos.d_y -= d_pixelSize.d_height;
		break;
	case Hook_Center:
		newPos.d_x -= d_pixelSize.d_width / 2;
		newPos.d_y -= d_pixelSize.d_height / 2;
		break;
	default:
		break;
	}
	UVector2  relativePos;
	d_area.setPosition( UVector2(cegui_absdim(PixelAligned(newPos.d_x)), cegui_absdim(PixelAligned( newPos.d_y) ) ) );
}