DynRPG  v0.14a
RM2k3 Plugin SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Public Attributes
RPG::Picture Class Reference

Used for in-game pictures. More...

List of all members.

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, RPG::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, RPG::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.
Imageimage
 RPG::Image buffer of the top half (see class description)
Imageimage2
 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!)

Detailed Description

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.

See also:
RPG::pictures
RPG::Image
RPG::PictureEffect

Member Function Documentation

Draws a picture to the screen, even in different game scenes than the map.

Erases a picture.

Warning:
This is an experimental function.

Draws the content of the bottom buffer onto the top buffer and clears the bottom buffer afterwards.

void RPG::Picture::move ( int  x,
int  y,
int  magnification,
int  transparency,
int  transparency2,
int  red,
int  green,
int  blue,
int  chroma,
RPG::PictureEffect  effect,
int  effectStrength,
int  duration 
)

Initiates a picture movement.

Parameters:
xTarget X position
yTarget Y position
magnificationTarget magnification
transparencyTarget top half transparency
transparency2Target bottom half transparency
redTarget red color effect value
greenTarget green color effect value
blueTarget blue color effect value
chromaTarget chroma color effect value
effectNew picture effect
effectStrengthTarget picture effect strength
durationDuration of the movement in frames
Warning:
This is an experimental function.
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,
RPG::PictureEffect  effect,
int  effectStrength 
)

Loads and shows a picture.

Parameters:
filenameFilename
xX position
yY position
moveWithMap"Move with map" active?
magnificationMagnification
transparencyTop half transparency
transparency2Bottom half transparency
useMaskColorUse a transparent color?
redRed color effect value
greenTarget green color effect value
blueBlue color effect value
chromaChroma color effect value
effectPicture effect
effectStrengthPicture effect strength
Warning:
This is an experimental function.

Updates picture movement and effects.

This function can be used to update picture movement and effects even in different game scenes than the map.

Warning:
If this function is called more than once per frame, the movement or animation will be too fast.

Member Data Documentation

Current picture angle (256 units equal to 360 degree!)

Current blue color effect value.

Current chroma color effect value.

Current picture effect.

Strength of picture effect (see details)

For RPG::PFX_ROTATE, negative values will rotate the picture conter-clockwise, while zero will pause the rotation.

Filename of the picture.

Current green color effect value.

Picture ID.

RPG::Image buffer of the top half (see class description)

RPG::Image buffer of the bottom half (see class description)

Current magnification.

Number of frames left until movement is completed (zero means not moving)

Is "Move with map" active?

X coordinate of original position (changes automatically when "Move with map" is used)

Y coordinate of original position (changes automatically when "Move with map" is used)

Current red color effect value.

Target blue color effect value (if moving)

Target chroma color effect value (if moving)

Target picture effect strength (if moving)

Target green color effect value (if moving)

Target magnification (if moving)

Target red color effect value (if moving)

Target transparency of the top half (if moving)

Target transparency of the bottom half (if moving)

Target X coordinate (if moving)

Target Y coordainte (if moving)

Current transparency for top half.

Current transparency for bottom half.

Use a transparent color?

Current X coordinate on screen (use std::lround to convert to an integer!)

Current Y coordinate on screen (use std::lround to convert to an integer!)

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator