DynRPG v0.32 Unofficial
Plugin SDK
|
Used for in-game pictures. More...
#include <Picture.h>
Public Member Functions | |
void | merge () |
Draws the content of the bottom buffer onto the top buffer and clears the bottom buffer afterwards. | |
void | show (std::string filename, int x, int y, bool moveWithMap, int magnification, int transparency, int transparency2, bool useMaskColor, int red, int green, int blue, int chroma, PictureEffect effect, int effectStrength) |
Loads and shows a picture. | |
void | move (int x, int y, int magnification, int transparency, int transparency2, int red, int green, int blue, int chroma, PictureEffect effect, int effectStrength, int duration) |
Initiates a picture movement. | |
void | erase () |
Erases a picture. | |
void | update () |
Updates picture movement and effects. | |
void | draw () |
Draws a picture to the screen, even in different game scenes than the map. | |
Public Attributes | |
int | id |
Picture ID. | |
Image * | image |
RPG::Image buffer of the top half (see class description) | |
Image * | image2 |
RPG::Image buffer of the bottom half (see class description) | |
DStringPtr | filename |
Filename of the picture. | |
double | originX |
X coordinate of original position (changes automatically when "Move with map" is used) | |
double | originY |
Y coordinate of original position (changes automatically when "Move with map" is used) | |
double | x |
Current X coordinate on screen (use std::lround to convert to an integer!) | |
double | y |
Current Y coordinate on screen (use std::lround to convert to an integer!) | |
bool | moveWithMap |
Is "Move with map" active? | |
double | magnification |
Current magnification. | |
double | transparency |
Current transparency for top half. | |
double | transparency2 |
Current transparency for bottom half. | |
bool | useMaskColor |
Use a transparent color? | |
double | red |
Current red color effect value. | |
double | green |
Current green color effect value. | |
double | blue |
Current blue color effect value. | |
double | chroma |
Current chroma color effect value. | |
PictureEffect | effect |
Current picture effect. | |
double | effectStrength |
Strength of picture effect (see details) | |
double | targetX |
Target X coordinate (if moving) | |
double | targetY |
Target Y coordainte (if moving) | |
int | targetMagnification |
Target magnification (if moving) | |
int | targetTransparency |
Target transparency of the top half (if moving) | |
int | targetTransparency2 |
Target transparency of the bottom half (if moving) | |
int | targetRed |
Target red color effect value (if moving) | |
int | targetGreen |
Target green color effect value (if moving) | |
int | targetBlue |
Target blue color effect value (if moving) | |
int | targetChroma |
Target chroma color effect value (if moving) | |
int | targetEffectStrength |
Target picture effect strength (if moving) | |
int | movementTimer |
Number of frames left until movement is completed (zero means not moving) | |
double | angle |
Current picture angle (256 units equal to 360 degree!) | |
Used for in-game pictures.
Pictures have two image buffers. The first one (image) is used for the top half of the image, the second one (image2) is used for the bottom half of the image. When the picture is drawn, the second buffer is drawn on top of the first buffer. I know that this is crazy, but it's the way the people from Enterbrain decided to do it to allow two different transparency values (a feature which, in my opinion, is also crazy and useless). Because this is impractical for plugin developers, there is a method called merge which will draw the content of the bottom buffer on top of the top buffer and clear the bottom buffer afterwards. You may still put your own stuff into the image2 buffer, it will be shown on top of image, but please remember that when the game is loaded, the RPG Maker splits the picture again. As a "marker" that the image is already merged (so that you don't have to do it every frame), you might change a palette entry of the bottom image.
void RPG::Picture::erase | ( | ) |
Erases a picture.
void RPG::Picture::move | ( | int | x, |
int | y, | ||
int | magnification, | ||
int | transparency, | ||
int | transparency2, | ||
int | red, | ||
int | green, | ||
int | blue, | ||
int | chroma, | ||
PictureEffect | effect, | ||
int | effectStrength, | ||
int | duration ) |
Initiates a picture movement.
x | Target X position |
y | Target Y position |
magnification | Target magnification |
transparency | Target top half transparency |
transparency2 | Target bottom half transparency |
red | Target red color effect value |
green | Target green color effect value |
blue | Target blue color effect value |
chroma | Target chroma color effect value |
effect | New picture effect |
effectStrength | Target picture effect strength |
duration | Duration of the movement in frames |
void RPG::Picture::show | ( | std::string | filename, |
int | x, | ||
int | y, | ||
bool | moveWithMap, | ||
int | magnification, | ||
int | transparency, | ||
int | transparency2, | ||
bool | useMaskColor, | ||
int | red, | ||
int | green, | ||
int | blue, | ||
int | chroma, | ||
PictureEffect | effect, | ||
int | effectStrength ) |
Loads and shows a picture.
filename | Filename |
x | X position |
y | Y position |
moveWithMap | "Move with map" active? |
magnification | Magnification |
transparency | Top half transparency |
transparency2 | Bottom half transparency |
useMaskColor | Use a transparent color? |
red | Red color effect value |
green | Target green color effect value |
blue | Blue color effect value |
chroma | Chroma color effect value |
effect | Picture effect |
effectStrength | Picture effect strength |
void RPG::Picture::update | ( | ) |
Updates picture movement and effects.
This function can be used to update picture movement and effects even in different game scenes than the map.
double RPG::Picture::effectStrength |
Strength of picture effect (see details)
For RPG::PFX_ROTATE, negative values will rotate the picture conter-clockwise, while zero will pause the rotation.