Open 3D Engine LyShine Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
SlicerManipulator Class Reference

On-screen control used to modify border info for 9-slicing sprites. More...

#include <SlicerManipulator.h>

Inherits QGraphicsRectItem.

Public Member Functions

 SlicerManipulator (SpriteBorder border, QSize &unscaledPixmapSize, QSize &scaledPixmapSize, ISprite *sprite, QGraphicsScene *scene, SlicerEdit *edit)
 
void SetEdit (SlicerEdit *edit)
 Associates a text input/QLineEdit control with this manipulator.
 
void SetPixmapSizes (const QSize &unscaledSize, const QSize &scaledSize)
 
void SetCellIndex (AZ::u32 cellIndex)
 
void setPixelPosition (float p)
 Changes the on-screen position of this manipulator based on the new border pixel value.
 

Protected Member Functions

QVariant itemChange (GraphicsItemChange change, const QVariant &value) override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
 
void hoverEnterEvent (QGraphicsSceneHoverEvent *event) override
 
void hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override
 

Detailed Description

On-screen control used to modify border info for 9-slicing sprites.

Member Function Documentation

◆ SetCellIndex()

void SlicerManipulator::SetCellIndex ( AZ::u32  cellIndex)
inline

A cell index can be provided when working with sprite-sheets.

The cell index is used to set the border info on the sprite-sheet cell as the border values are manipulated by the user with this manipulator.

◆ SetPixmapSizes()

void SlicerManipulator::SetPixmapSizes ( const QSize &  unscaledSize,
const QSize &  scaledSize 
)

Provides the scale and unscale sprite sizes as displayed in the properties pane.

This method is intended to be called when the displayed pixmap/image changes, such as when the user selects a different cell of a sprite-sheet.

The scale values themselves are primarily used to convert between viewport and spritesheet cell texture spaces.


The documentation for this class was generated from the following file: