mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added 'combine' option to ColorStyle.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1069 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -142,6 +142,7 @@ The rest of the properties depend on the type of [[type:field]] this style is fo
|
||||
| ^^^ @top width@ ^^^ ^^^ ^^^
|
||||
| ^^^ @bottom width@ ^^^ ^^^ ^^^
|
||||
| ^^^ @mask@ [[type:scriptable]] [[type:filename]] ''none'' A mask to apply to the box, black areas in the mask become transparent.
|
||||
| ^^^ @combine@ [[type:combine]] @"normal"@ How to combine the color with the background? Only applies when a mask is used.
|
||||
|
||||
! <<< <<< <<< <<<
|
||||
| @"image"@ @mask@ [[type:scriptable]] [[type:filename]] ''none'' A mask to apply to the image, black areas in the mask become transparent, similair to [[fun:set_mask]].
|
||||
|
||||
@@ -52,6 +52,7 @@ ColorStyle::ColorStyle(const ColorFieldP& field)
|
||||
, radius(0)
|
||||
, left_width(100000), right_width (100000)
|
||||
, top_width (100000), bottom_width(100000)
|
||||
, combine(COMBINE_NORMAL)
|
||||
{}
|
||||
|
||||
IMPLEMENT_REFLECTION(ColorStyle) {
|
||||
@@ -62,6 +63,7 @@ IMPLEMENT_REFLECTION(ColorStyle) {
|
||||
REFLECT(top_width);
|
||||
REFLECT(bottom_width);
|
||||
REFLECT_N("mask", mask_filename);
|
||||
REFLECT(combine);
|
||||
}
|
||||
|
||||
int ColorStyle::update(Context& ctx) {
|
||||
|
||||
@@ -62,6 +62,7 @@ class ColorStyle : public Style {
|
||||
double top_width; ///< Width of the colored region on the top side
|
||||
double bottom_width; ///< Width of the colored region on the bottom side
|
||||
Scriptable<String> mask_filename; ///< Filename of an additional mask over the images
|
||||
Scriptable<ImageCombine> combine; ///< How to combine image with the background
|
||||
|
||||
virtual int update(Context&);
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ void ColorValueViewer::draw(RotatedDC& dc) {
|
||||
Image img(alpha_mask->size.x, alpha_mask->size.y);
|
||||
fill_image(img, value().value());
|
||||
alpha_mask->setAlpha(img);
|
||||
dc.DrawImage(img, RealPoint(0,0));
|
||||
dc.DrawImage(img, RealPoint(0,0), style().combine);
|
||||
} else {
|
||||
// do we need clipping?
|
||||
bool clip = style().left_width < style().width && style().right_width < style().width &&
|
||||
|
||||
Reference in New Issue
Block a user