mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00

* A custom center point can be set (and will be at the center of the drawing if not specified). * The collision mask is now a rectangle surrounding what is drawn on screen. * If this changes something in your game, or you want another collision mask, you can use the action to set a custom rectangle as the collision mask of the object.
795 lines
34 KiB
C++
795 lines
34 KiB
C++
/**
|
|
|
|
GDevelop - Primitive Drawing Extension
|
|
Copyright (c) 2008-2016 Florian Rival (Florian.Rival@gmail.com)
|
|
This project is released under the MIT License.
|
|
*/
|
|
|
|
#include "GDCore/Extensions/Metadata/MultipleInstructionMetadata.h"
|
|
#include "GDCore/Extensions/PlatformExtension.h"
|
|
#include "GDCore/Tools/Localization.h"
|
|
#include "ShapePainterObject.h"
|
|
|
|
void DeclarePrimitiveDrawingExtension(gd::PlatformExtension& extension) {
|
|
extension
|
|
.SetExtensionInformation(
|
|
"PrimitiveDrawing",
|
|
_("Shape painter"),
|
|
_("This provides an object that can be used to draw arbitrary shapes "
|
|
"on the screen using events."),
|
|
"Florian Rival and Aurélien Vivet",
|
|
"Open source (MIT License)")
|
|
.SetExtensionHelpPath("/objects/shape_painter");
|
|
|
|
gd::ObjectMetadata& obj = extension.AddObject<ShapePainterObject>(
|
|
"Drawer", //"Drawer" is kept for compatibility with GD<=3.6.76
|
|
_("Shape painter"),
|
|
_("Allows you to draw simple shapes on the screen"),
|
|
"CppPlatform/Extensions/primitivedrawingicon.png");
|
|
|
|
#if defined(GD_IDE_ONLY)
|
|
obj.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction(
|
|
"Rectangle",
|
|
_("Rectangle"),
|
|
_("Draw a rectangle on screen"),
|
|
_("Draw from _PARAM1_;_PARAM2_ to _PARAM3_;_PARAM4_ a rectangle "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/rectangle24.png",
|
|
"res/actions/rectangle.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("Left X position"))
|
|
.AddParameter("expression", _("Top Y position"))
|
|
.AddParameter("expression", _("Right X position"))
|
|
.AddParameter("expression", _("Bottom Y position"))
|
|
.SetFunctionName("DrawRectangle")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("Circle",
|
|
_("Circle"),
|
|
_("Draw a circle on screen"),
|
|
_("Draw at _PARAM1_;_PARAM2_ a circle of radius _PARAM3_ "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/circle24.png",
|
|
"res/actions/circle.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of center"))
|
|
.AddParameter("expression", _("Y position of center"))
|
|
.AddParameter("expression", _("Radius (in pixels)"))
|
|
.SetFunctionName("DrawCircle")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("Line",
|
|
_("Line"),
|
|
"Draw a line on screen",
|
|
"Draw from _PARAM1_;_PARAM2_ to _PARAM3_;_PARAM4_ a line "
|
|
"(thickness: _PARAM5_) "
|
|
"with _PARAM0_",
|
|
_("Drawing"),
|
|
"res/actions/line24.png",
|
|
"res/actions/line.png")
|
|
|
|
.SetHidden()
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of start point"))
|
|
.AddParameter("expression", _("Y position of start point"))
|
|
.AddParameter("expression", _("X position of end point"))
|
|
.AddParameter("expression", _("Y position of end point"))
|
|
.AddParameter("expression", _("Thickness (in pixels)"))
|
|
.SetFunctionName("DrawLine")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("LineV2",
|
|
_("Line"),
|
|
_("Draw a line on screen"),
|
|
_("Draw from _PARAM1_;_PARAM2_ to _PARAM3_;_PARAM4_ a line "
|
|
"(thickness: _PARAM5_) "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/line24.png",
|
|
"res/actions/line.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of start point"))
|
|
.AddParameter("expression", _("Y position of start point"))
|
|
.AddParameter("expression", _("X position of end point"))
|
|
.AddParameter("expression", _("Y position of end point"))
|
|
.AddParameter("expression", _("Thickness (in pixels)"))
|
|
.SetFunctionName("drawLineV2")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("Ellipse",
|
|
_("Ellipse"),
|
|
_("Draw an ellipse on screen"),
|
|
_("Draw at _PARAM1_;_PARAM2_ an ellipse of width _PARAM3_ and "
|
|
"height _PARAM4_ "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/ellipse24.png",
|
|
"res/actions/ellipse.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of center"))
|
|
.AddParameter("expression", _("Y position of center"))
|
|
.AddParameter("expression", _("The width of the ellipse"))
|
|
.AddParameter("expression", _("The height of the ellipse"))
|
|
.SetFunctionName("DrawEllipse")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("RoundedRectangle",
|
|
_("Rounded rectangle"),
|
|
_("Draw a rounded rectangle on screen"),
|
|
_("Draw from _PARAM1_;_PARAM2_ to _PARAM3_;_PARAM4_ a rounded "
|
|
"rectangle (radius: _PARAM5_) "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/roundedRectangle24.png",
|
|
"res/actions/roundedRectangle.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("Left X position"))
|
|
.AddParameter("expression", _("Top Y position"))
|
|
.AddParameter("expression", _("Right X position"))
|
|
.AddParameter("expression", _("Bottom Y position"))
|
|
.AddParameter("expression", _("Radius (in pixels)"))
|
|
.SetFunctionName("DrawRoundedRectangle")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction(
|
|
"Star",
|
|
_("Star"),
|
|
_("Draw a star on screen"),
|
|
_("Draw at _PARAM1_;_PARAM2_ a star with _PARAM3_ points and radius: "
|
|
"_PARAM4_ (inner radius: _PARAM5_, rotation: _PARAM6_) "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/star24.png",
|
|
"res/actions/star.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of center"))
|
|
.AddParameter("expression", _("Y position of center"))
|
|
.AddParameter("expression",
|
|
_("Number of points of the star (minimum: 2)"))
|
|
.AddParameter("expression", _("Radius (in pixels)"))
|
|
.AddParameter("expression",
|
|
_("Inner radius (in pixels, half radius by default)"))
|
|
.AddParameter("expression", _("Rotation (in degrees)"))
|
|
.SetFunctionName("DrawStar")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("Arc",
|
|
_("Arc"),
|
|
_("Draw an arc on screen. If \"Close path\" is set to yes, a "
|
|
"line will be drawn between the start and end point of the "
|
|
"arc, closing the shape."),
|
|
_("Draw at _PARAM1_;_PARAM2_ an arc with radius: _PARAM3_, "
|
|
"start angle: _PARAM4_, end angle: _PARAM5_ (anticlockwise: "
|
|
"_PARAM6_, close path: _PARAM7_) "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/arc24.png",
|
|
"res/actions/arc.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of center"))
|
|
.AddParameter("expression", _("Y position of center"))
|
|
.AddParameter("expression", _("Radius (in pixels)"))
|
|
.AddParameter("expression", _("Start angle of the arc (in degrees)"))
|
|
.AddParameter("expression", _("End angle of the arc (in degrees)"))
|
|
.AddParameter("yesorno", _("Anticlockwise"))
|
|
.AddParameter("yesorno", _("Close path"))
|
|
.SetFunctionName("DrawArc")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("BezierCurve",
|
|
_("Bezier curve"),
|
|
_("Draw a bezier curve on screen"),
|
|
_("Draw from _PARAM1_;_PARAM2_ to _PARAM7_;_PARAM8_ a bezier "
|
|
"curve (first control point: _PARAM3_;_PARAM4_, second "
|
|
"control point: _PARAM5_;_PARAM6_) "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/bezierCurve24.png",
|
|
"res/actions/bezierCurve.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of start point"))
|
|
.AddParameter("expression", _("Y position of start point"))
|
|
.AddParameter("expression", _("First control point x"))
|
|
.AddParameter("expression", _("First control point y"))
|
|
.AddParameter("expression", _("Second Control point x"))
|
|
.AddParameter("expression", _("Second Control point y"))
|
|
.AddParameter("expression", _("Destination point x"))
|
|
.AddParameter("expression", _("Destination point y"))
|
|
.SetFunctionName("drawBezierCurve")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("QuadraticCurve",
|
|
_("Quadratic curve"),
|
|
_("Draw a quadratic curve on screen"),
|
|
_("Draw from _PARAM1_;_PARAM2_ to _PARAM5_;_PARAM6_ a "
|
|
"quadratic curve (control point: _PARAM3_;_PARAM4_) "
|
|
"with _PARAM0_"),
|
|
_("Drawing"),
|
|
"res/actions/quadraticCurve24.png",
|
|
"res/actions/quadraticCurve.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of start point"))
|
|
.AddParameter("expression", _("Y position of start point"))
|
|
.AddParameter("expression", _("Control point x"))
|
|
.AddParameter("expression", _("Control point y"))
|
|
.AddParameter("expression", _("Destination point x"))
|
|
.AddParameter("expression", _("Destination point y"))
|
|
.SetFunctionName("drawQuadraticCurve")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("BeginFillPath",
|
|
_("Begin fill path"),
|
|
_("Begin to draw a simple one-color fill. Subsequent actions, "
|
|
"such as \"Path line\" (in the Advanced category) can be "
|
|
"used to draw. Be sure to use \"End fill path\" action when "
|
|
"you're done drawing the shape."),
|
|
_("Begins drawing filling of an advanced path "
|
|
"with _PARAM0_ (start: _PARAM1_;_PARAM2_)"),
|
|
_("Advanced"),
|
|
"res/actions/beginFillPath24.png",
|
|
"res/actions/beginFillPath.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("Start drawing x"))
|
|
.AddParameter("expression", _("Start drawing y"))
|
|
.SetFunctionName("beginFillPath")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("EndFillPath",
|
|
_("End fill path"),
|
|
_("Finish the filling drawing in an advanced path"),
|
|
_("Finish the filling drawing in an advanced path "
|
|
"with _PARAM0_"),
|
|
_("Advanced"),
|
|
"res/actions/endFillPath24.png",
|
|
"res/actions/endFillPath.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("endFillPath")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("MovePathTo",
|
|
_("Move path drawing position"),
|
|
_("Move the drawing position for the current path"),
|
|
_("Move the drawing position of the path to _PARAM1_;_PARAM2_ "
|
|
"with _PARAM0_"),
|
|
_("Advanced"),
|
|
"res/actions/position24.png",
|
|
"res/actions/position.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of start point"))
|
|
.AddParameter("expression", _("Y position of start point"))
|
|
.SetFunctionName("drawPathMoveTo")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("PathLineTo",
|
|
_("Path line"),
|
|
_("Add to a path a line to a position. The origin comes from "
|
|
"the previous action or from \"Begin fill path\" or \"Move "
|
|
"path drawing position\". By default, the start position "
|
|
"will be the object's position."),
|
|
_("Add to a path a line to the position _PARAM1_;_PARAM2_ "
|
|
"with _PARAM0_"),
|
|
_("Advanced"),
|
|
"res/actions/line24.png",
|
|
"res/actions/line.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("X position of start point"))
|
|
.AddParameter("expression", _("Y position of start point"))
|
|
.SetFunctionName("drawPathLineTo")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("PathBezierCurveTo",
|
|
_("Path bezier curve"),
|
|
_("Add to a path a bezier curve to a position. The origin "
|
|
"comes from the previous action or from \"Begin fill path\" "
|
|
"or \"Move path drawing position\". By default, the start "
|
|
"position will be the object's position."),
|
|
_("Add to a path a bezier curve to the position "
|
|
"_PARAM5_;_PARAM6_ (first control point: _PARAM1_;_PARAM2_, "
|
|
"second control point: _PARAM3_;_PARAM4_) "
|
|
"with _PARAM0_"),
|
|
_("Advanced"),
|
|
"res/actions/bezierCurve24.png",
|
|
"res/actions/bezierCurve.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("First control point x"))
|
|
.AddParameter("expression", _("First control point y"))
|
|
.AddParameter("expression", _("Second Control point x"))
|
|
.AddParameter("expression", _("Second Control point y"))
|
|
.AddParameter("expression", _("Destination point x"))
|
|
.AddParameter("expression", _("Destination point y"))
|
|
.SetFunctionName("drawPathBezierCurveTo")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("PathArc",
|
|
_("Path arc"),
|
|
_("Add to a path an arc to a position. The origin comes from "
|
|
"the previous action or from \"Begin fill path\" or \"Move "
|
|
"path drawing position\". By default, the start position "
|
|
"will be the object's position."),
|
|
_("Add to a path an arc at the position _PARAM1_;_PARAM2_ "
|
|
"(radius: _PARAM3_, start angle: _PARAM4_, end angle: "
|
|
"_PARAM5_, anticlockwise: _PARAM6_) "
|
|
"with _PARAM0_"),
|
|
_("Advanced"),
|
|
"res/actions/arc24.png",
|
|
"res/actions/arc.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("Center x of circle"))
|
|
.AddParameter("expression", _("Center y of circle"))
|
|
.AddParameter("expression", _("Radius (in pixels)"))
|
|
.AddParameter("expression", _("Start angle"))
|
|
.AddParameter("expression", _("End angle"))
|
|
.AddParameter("yesorno", _("Anticlockwise"))
|
|
.SetFunctionName("drawPathArc")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("PathQuadraticCurveTo",
|
|
_("Path quadratic curve"),
|
|
_("Add to a path a quadratic curve to a position. The origin "
|
|
"comes from the previous action or from \"Begin fill path\" "
|
|
"or \"Move path drawing position\". By default, the start "
|
|
"position will be the object's position."),
|
|
_("Add to a path a quadratic curve to the position "
|
|
"_PARAM3_;_PARAM4_ (control point: _PARAM1_;_PARAM2_) "
|
|
"with _PARAM0_"),
|
|
_("Advanced"),
|
|
"res/actions/quadraticCurve24.png",
|
|
"res/actions/quadraticCurve.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("expression", _("Control point x"))
|
|
.AddParameter("expression", _("Control point y"))
|
|
.AddParameter("expression", _("Destination point x"))
|
|
.AddParameter("expression", _("Destination point y"))
|
|
.SetFunctionName("drawPathQuadraticCurveTo")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("closePath",
|
|
_("Close Path"),
|
|
_("Close the path of the advanced shape. This closes the "
|
|
"outline between the last and the first point."),
|
|
_("Close the path "
|
|
"with _PARAM0_"),
|
|
_("Advanced"),
|
|
"res/actions/closePath24.png",
|
|
"res/actions/closePath.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("closePath")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddScopedAction(
|
|
"ClearShapes",
|
|
_("Clear shapes"),
|
|
_("Clear the rendered shape(s). Useful if not set to be done automatically."),
|
|
_("Clear the rendered image of _PARAM0_"),
|
|
_("Advanced"),
|
|
"res/actions/visibilite24.png",
|
|
"res/actions/visibilite.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer");
|
|
|
|
obj.AddAction(
|
|
"ClearBetweenFrames",
|
|
_("Clear between frames"),
|
|
_("Activate (or deactivate) the clearing of the rendered shape at the "
|
|
"beginning of each frame."),
|
|
_("Clear the rendered image of _PARAM0_ between each frame: _PARAM1_"),
|
|
_("Setup"),
|
|
"res/actions/visibilite24.png",
|
|
"res/actions/visibilite.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("yesorno", _("Clear between each frame"), "", true)
|
|
.SetDefaultValue("yes")
|
|
.SetFunctionName("SetClearBetweenFrames")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddCondition(
|
|
"ClearBetweenFrames",
|
|
_("Clear between frames"),
|
|
_("Check if the rendered image is cleared between frames."),
|
|
_("_PARAM0_ is clearing its rendered image between each frame"),
|
|
_("Setup"),
|
|
"res/conditions/visibilite24.png",
|
|
"res/conditions/visibilite.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("IsClearedBetweenFrames")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("FillColor",
|
|
_("Fill color"),
|
|
_("Change the color used when filling"),
|
|
_("Change fill color of _PARAM0_ to _PARAM1_"),
|
|
_("Setup"),
|
|
"res/actions/color24.png",
|
|
"res/actions/color.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("color", _("Fill color"))
|
|
.SetFunctionName("SetFillColor")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("FillColorRed",
|
|
_("Filing color red component"),
|
|
_("Filing color red component"),
|
|
"",
|
|
"res/actions/color.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetFillColorR")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("FillColorGreen",
|
|
_("Filing color green component"),
|
|
_("Filing color green component"),
|
|
"",
|
|
"res/actions/color.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetFillColorG")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("FillColorBlue",
|
|
_("Filing color blue component"),
|
|
_("Filing color blue component"),
|
|
"",
|
|
"res/actions/color.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetFillColorB")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("OutlineColor",
|
|
_("Outline color"),
|
|
_("Modify the color of the outline of future drawings."),
|
|
_("Change outline color of _PARAM0_ to _PARAM1_"),
|
|
_("Setup"),
|
|
"res/actions/color24.png",
|
|
"res/actions/color.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("color", _("Color"))
|
|
.SetFunctionName("SetOutlineColor")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("OutlineColorRed",
|
|
_("Outline color red component"),
|
|
_("Outline color red component"),
|
|
"",
|
|
"res/actions/color.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetOutlineColorR")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("OutlineColorGreen",
|
|
_("Outline color green component"),
|
|
_("Outline color green component"),
|
|
"",
|
|
"res/actions/color.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetOutlineColorG")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("OutlineColorBlue",
|
|
_("Outline color blue component"),
|
|
_("Outline color blue component"),
|
|
"",
|
|
"res/actions/color.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetOutlineColorB")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("OutlineSize",
|
|
_("Outline size"),
|
|
_("Modify the size of the outline of future drawings."),
|
|
_("the size of the outline"),
|
|
_("Setup"),
|
|
"res/actions/outlineSize24.png",
|
|
"res/actions/outlineSize.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.UseStandardOperatorParameters("number")
|
|
.SetFunctionName("SetOutlineSize")
|
|
.SetGetter("GetOutlineSize")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddCondition("OutlineSize",
|
|
_("Outline size"),
|
|
_("Test the size of the outline."),
|
|
_("the size of the outline"),
|
|
_("Setup"),
|
|
"res/conditions/outlineSize24.png",
|
|
"res/conditions/outlineSize.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.UseStandardRelationalOperatorParameters("number")
|
|
.SetFunctionName("GetOutlineSize")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("OutlineSize",
|
|
_("Outline size"),
|
|
_("Outline size"),
|
|
"",
|
|
"res/conditions/outlineSize.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetOutlineSize")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction(
|
|
"FillOpacity",
|
|
_("Fill opacity"),
|
|
_("Modify the opacity level used when filling future drawings."),
|
|
_("the opacity of filling"),
|
|
_("Setup"),
|
|
"res/actions/opacity24.png",
|
|
"res/actions/opacity.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.UseStandardOperatorParameters("number")
|
|
.SetFunctionName("SetFillOpacity")
|
|
.SetGetter("GetFillOpacity")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddCondition("FillOpacity",
|
|
_("Fill opacity"),
|
|
_("Test the value of the opacity level used when filling."),
|
|
_("the opacity of filling"),
|
|
_("Setup"),
|
|
"res/conditions/opacity24.png",
|
|
"res/conditions/opacity.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.UseStandardRelationalOperatorParameters("number")
|
|
.SetFunctionName("GetFillOpacity")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("FillOpacity",
|
|
_("Filling opacity"),
|
|
_("Filling opacity"),
|
|
"",
|
|
"res/conditions/opacity.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetFillOpacity")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("OutlineOpacity",
|
|
_("Outline opacity"),
|
|
_("Modify the opacity of the outline of future drawings."),
|
|
_("the opacity of the outline"),
|
|
_("Setup"),
|
|
"res/actions/opacity24.png",
|
|
"res/actions/opacity.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.UseStandardOperatorParameters("number")
|
|
.SetFunctionName("SetOutlineOpacity")
|
|
.SetGetter("GetOutlineOpacity")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddCondition("OutlineOpacity",
|
|
_("Outline opacity"),
|
|
_("Test the opacity of the outline."),
|
|
_("the opacity of the outline"),
|
|
_("Setup"),
|
|
"res/conditions/opacity24.png",
|
|
"res/conditions/opacity.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.UseStandardRelationalOperatorParameters("number")
|
|
.SetFunctionName("GetOutlineOpacity")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddExpression("OutlineOpacity",
|
|
_("Outline opacity"),
|
|
_("Outline opacity"),
|
|
"",
|
|
"res/conditions/opacity.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("GetOutlineOpacity")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction(
|
|
"UseRelativeCoordinates",
|
|
_("Use relative coordinates"),
|
|
_("Set if the object should use relative coordinates (by default) or "
|
|
"not. It's recommended to use relative coordinates."),
|
|
_("Use relative coordinates for _PARAM0_: _PARAM1_"),
|
|
_("Setup"),
|
|
"res/actions/position24.png",
|
|
"res/actions/position.png")
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.AddParameter("yesorno", _("Use relative coordinates?"), "", false)
|
|
.SetDefaultValue("true")
|
|
.SetFunctionName("setCoordinatesRelative")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddCondition(
|
|
"AreCoordinatesRelative",
|
|
_("Relative coordinates"),
|
|
_("Check if the coordinates of the shape painter is relative."),
|
|
_("_PARAM0_ is using relative coordinates"),
|
|
_("Setup"),
|
|
"res/conditions/position24.png",
|
|
"res/conditions/position.png")
|
|
|
|
.AddParameter("object", _("Shape Painter object"), "Drawer")
|
|
.SetFunctionName("AreCoordinatesRelative")
|
|
.SetIncludeFile("PrimitiveDrawing/ShapePainterObject.h");
|
|
|
|
obj.AddAction("Scale",
|
|
_("Scale"),
|
|
_("Modify the scale of the specified object."),
|
|
_("the scale"),
|
|
_("Size"),
|
|
"res/actions/scale24.png",
|
|
"res/actions/scale.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.UseStandardOperatorParameters("number")
|
|
.MarkAsAdvanced();
|
|
|
|
obj.AddExpressionAndConditionAndAction("number",
|
|
"ScaleX",
|
|
_("Scale on X axis"),
|
|
_("the width's scale of an object"),
|
|
_("the width's scale"),
|
|
_("Size"),
|
|
"res/actions/scaleWidth24.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.UseStandardParameters("number")
|
|
.MarkAsAdvanced();
|
|
|
|
obj.AddExpressionAndConditionAndAction("number",
|
|
"ScaleY",
|
|
_("Scale on Y axis"),
|
|
_("the height's scale of an object"),
|
|
_("the height's scale"),
|
|
_("Size"),
|
|
"res/actions/scaleHeight24.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.UseStandardParameters("number")
|
|
.MarkAsAdvanced();
|
|
|
|
obj.AddAction("FlipX",
|
|
_("Flip the object horizontally"),
|
|
_("Flip the object horizontally"),
|
|
_("Flip horizontally _PARAM0_: _PARAM1_"),
|
|
_("Effects"),
|
|
"res/actions/flipX24.png",
|
|
"res/actions/flipX.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.AddParameter("yesorno", _("Activate flipping"))
|
|
.MarkAsSimple();
|
|
|
|
obj.AddAction("FlipY",
|
|
_("Flip the object vertically"),
|
|
_("Flip the object vertically"),
|
|
_("Flip vertically _PARAM0_: _PARAM1_"),
|
|
_("Effects"),
|
|
"res/actions/flipY24.png",
|
|
"res/actions/flipY.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.AddParameter("yesorno", _("Activate flipping"))
|
|
.MarkAsSimple();
|
|
|
|
obj.AddCondition("FlippedX",
|
|
_("Horizontally flipped"),
|
|
_("Check if the object is horizontally flipped"),
|
|
_("_PARAM0_ is horizontally flipped"),
|
|
_("Effects"),
|
|
"res/actions/flipX24.png",
|
|
"res/actions/flipX.png")
|
|
.AddParameter("object", _("Object"), "Drawer");
|
|
|
|
obj.AddCondition("FlippedY",
|
|
_("Vertically flipped"),
|
|
_("Check if the object is vertically flipped"),
|
|
_("_PARAM0_ is vertically flipped"),
|
|
_("Effects"),
|
|
"res/actions/flipY24.png",
|
|
"res/actions/flipY.png")
|
|
.AddParameter("object", _("Object"), "Drawer");
|
|
|
|
obj.AddAction("Width",
|
|
_("Width"),
|
|
_("Change the width of an object."),
|
|
_("the width"),
|
|
_("Size"),
|
|
"res/actions/scaleWidth24.png",
|
|
"res/actions/scale.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.UseStandardOperatorParameters("number")
|
|
.MarkAsAdvanced();
|
|
|
|
obj.AddAction("Height",
|
|
_("Height"),
|
|
_("Change the height of an object."),
|
|
_("the height"),
|
|
_("Size"),
|
|
"res/actions/scaleHeight24.png",
|
|
"res/actions/scale.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.UseStandardOperatorParameters("number")
|
|
.MarkAsAdvanced();
|
|
|
|
obj.AddAction("SetRotationCenter",
|
|
_("Center of rotation"),
|
|
_("Change the center of rotation of an object relatively to the object origin."),
|
|
_("Change the center of rotation of _PARAM0_: _PARAM1_; _PARAM2_"),
|
|
_("Angle"),
|
|
"res/actions/position24.png",
|
|
"res/actions/position.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.AddParameter("expression", _("X position"))
|
|
.AddParameter("expression", _("Y position"))
|
|
.MarkAsAdvanced();
|
|
|
|
obj.AddAction("SetRectangularCollisionMask",
|
|
_("Collision Mask"),
|
|
_("Change the collision mask of an object to a rectangle relatively to the object origin."),
|
|
_("Change the collision mask of _PARAM0_ to a rectangle from _PARAM1_; _PARAM2_ to _PARAM3_; _PARAM4_"),
|
|
_("Position"),
|
|
"res/actions/position24.png",
|
|
"res/actions/position.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.AddParameter("expression", _("Left X position"))
|
|
.AddParameter("expression", _("Top Y position"))
|
|
.AddParameter("expression", _("Right X position"))
|
|
.AddParameter("expression", _("Bottom Y position"))
|
|
.MarkAsAdvanced();
|
|
|
|
obj.AddExpression("ToDrawingX",
|
|
_("X drawing coordinate of a point from the scene"),
|
|
_("X drawing coordinate of a point from the scene"),
|
|
_("Position"),
|
|
"res/actions/position.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.AddParameter("expression", _("X scene position"))
|
|
.AddParameter("expression", _("Y scene position"));
|
|
|
|
obj.AddExpression("ToDrawingY",
|
|
_("Y drawing coordinate of a point from the scene"),
|
|
_("Y drawing coordinate of a point from the scene"),
|
|
_("Position"),
|
|
"res/actions/position.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.AddParameter("expression", _("X scene position"))
|
|
.AddParameter("expression", _("Y scene position"));
|
|
|
|
obj.AddExpression("ToSceneX",
|
|
_("X scene coordinate of a point from the drawing"),
|
|
_("X scene coordinate of a point from the drawing"),
|
|
_("Position"),
|
|
"res/actions/position.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.AddParameter("expression", _("X drawing position"))
|
|
.AddParameter("expression", _("Y drawing position"));
|
|
|
|
obj.AddExpression("ToSceneY",
|
|
_("Y scene coordinate of a point from the drawing"),
|
|
_("Y scene coordinate of a point from the drawing"),
|
|
_("Position"),
|
|
"res/actions/position.png")
|
|
.AddParameter("object", _("Object"), "Drawer")
|
|
.AddParameter("expression", _("X drawing position"))
|
|
.AddParameter("expression", _("Y drawing position"));
|
|
|
|
#endif
|
|
}
|