Beispiel #1
0
//----------------------------------------------------------------------------//
void Font::setNativeResolution(const Sizef& size)
{
    d_nativeResolution = size;

    // re-calculate scaling factors & notify images as required
    notifyDisplaySizeChanged(
        System::getSingleton().getRenderer()->getDisplaySize());
}
Beispiel #2
0
//----------------------------------------------------------------------------//
void BasicImage::setNativeResolution(const Sizef& native_res)
{
    d_nativeResolution = native_res;

    if (d_autoScaled != ASM_Disabled)
        notifyDisplaySizeChanged(
            System::getSingleton().getRenderer()->getDisplaySize());
}
Beispiel #3
0
//----------------------------------------------------------------------------//
void BasicImage::setOffset(const Vector2f& pixel_offset)
{
    d_pixelOffset = pixel_offset;

    if (d_autoScaled != ASM_Disabled)
        notifyDisplaySizeChanged(
            System::getSingleton().getRenderer()->getDisplaySize());
}
Beispiel #4
0
/*************************************************************************
	Set the native resolution for this Imageset
*************************************************************************/
void Imageset::setNativeResolution(const Size& size)
{
	d_nativeHorzRes = size.d_width;
	d_nativeVertRes = size.d_height;

	// re-calculate scaling factors & notify images as required
	notifyDisplaySizeChanged(
       System::getSingleton().getRenderer()->getDisplaySize());
}
Beispiel #5
0
//----------------------------------------------------------------------------//
void BasicImage::setArea(const Rectf& pixel_area)
{
    d_area = pixel_area;
    d_pixelSize = pixel_area.getSize();

    if (d_autoScaled != ASM_Disabled)
        notifyDisplaySizeChanged(
            System::getSingleton().getRenderer()->getDisplaySize());
}
Beispiel #6
0
//----------------------------------------------------------------------------//
void BasicImage::setAutoScaled(const AutoScaledMode autoscaled)
{
    d_autoScaled = autoscaled;

    if (d_autoScaled != ASM_Disabled)
    {
        notifyDisplaySizeChanged(
            System::getSingleton().getRenderer()->getDisplaySize());
    }
    else
    {
        d_scaledSize = d_pixelSize;
        d_scaledOffset = d_pixelOffset;
    }
}
Beispiel #7
0
//----------------------------------------------------------------------------//
BasicImage::BasicImage(const String& name, Texture* texture,
                       const Rectf& pixel_area, const Vector2f& pixel_offset,
                       const AutoScaledMode autoscaled, const Sizef& native_res) :
    d_name(name),
    d_texture(texture),
    d_pixelSize(pixel_area.getSize()),
    d_area(pixel_area),
    d_pixelOffset(pixel_offset),
    d_autoScaled(autoscaled),
    d_nativeResolution(native_res)

{
    // force initialisation of the autoscaling fields.
    notifyDisplaySizeChanged(
        System::getSingleton().getRenderer()->getDisplaySize());
}
Beispiel #8
0
//----------------------------------------------------------------------------//
BasicImage::BasicImage(const XMLAttributes& attributes) :
    d_name(attributes.getValueAsString(ImageNameAttribute)),
    d_texture(&System::getSingleton().getRenderer()->getTexture(
              attributes.getValueAsString(ImageTextureAttribute))),
    d_pixelSize(static_cast<float>(attributes.getValueAsInteger(ImageWidthAttribute, 0)),
                static_cast<float>(attributes.getValueAsInteger(ImageHeightAttribute, 0))),
    d_area(Vector2f(static_cast<float>(attributes.getValueAsInteger(ImageXPosAttribute, 0)),
                    static_cast<float>(attributes.getValueAsInteger(ImageYPosAttribute, 0))),
           d_pixelSize),
    d_pixelOffset(Vector2f(
        static_cast<float>(attributes.getValueAsInteger(ImageXOffsetAttribute, 0)),
        static_cast<float>(attributes.getValueAsInteger(ImageYOffsetAttribute, 0)))),
    d_nativeResolution(Sizef(
        static_cast<float>(attributes.getValueAsInteger(ImageNativeHorzResAttribute, 640)),
        static_cast<float>(attributes.getValueAsInteger(ImageNativeVertResAttribute, 480))))
{
    d_autoScaled = PropertyHelper<AutoScaledMode>::fromString(attributes.getValueAsString(ImageAutoScaledAttribute));

    // force initialisation of the autoscaling fields.
    notifyDisplaySizeChanged(
        System::getSingleton().getRenderer()->getDisplaySize());
}