Exemplo n.º 1
0
    /**
     * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    Extension()
    {
        DeclarePanelSpriteObjectExtension(*this);
        AddRuntimeObject(GetObjectMetadata("PanelSpriteObject::PanelSprite"),
            "RuntimePanelSpriteObject", CreateRuntimePanelSpriteObject);

        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Exemplo n.º 2
0
    /**
     * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    Extension()
    {
        DeclareTextObjectExtension(*this);
        AddRuntimeObject(GetObjectMetadata("TextObject::Text"),
            "RuntimeTextObject", CreateRuntimeTextObject);

        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Exemplo n.º 3
0
    /**
     * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    TileMapObjectCppExtension()
    {
        DeclareTileMapObjectExtension(*this);
        AddRuntimeObject<TileMapObject, RuntimeTileMapObject>(
            GetObjectMetadata("TileMapObject::TileMap"),
            "RuntimeTileMapObject");

        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Exemplo n.º 4
0
    /**
     * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    AdMobObjectJsExtension()
    {
        DeclareAdMobObjectExtension(*this);

        GetObjectMetadata("AdMobObject::AdMob").SetIncludeFile("AdMobObject/admobruntimeobject.js");

        GetAllActionsForObject("AdMobObject::AdMob")["AdMobObject::ShowBanner"].SetFunctionName("showBanner");
        GetAllActionsForObject("AdMobObject::AdMob")["AdMobObject::HideBanner"].SetFunctionName("hideBanner");
        GetAllConditionsForObject("AdMobObject::AdMob")["AdMobObject::BannerDisplayed"].SetFunctionName("isBannerDisplayed");
        GetAllActionsForObject("AdMobObject::AdMob")["AdMobObject::PreloadInterstitial"].SetFunctionName("prepareInterstitial");
        GetAllActionsForObject("AdMobObject::AdMob")["AdMobObject::ShowInterstitial"].SetFunctionName("showInterstitial");
        GetAllConditionsForObject("AdMobObject::AdMob")["AdMobObject::InterstitialReady"].SetFunctionName("isInterstitialReady");

        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Exemplo n.º 5
0
    /**
     * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    TiledSpriteObjectJsExtension()
    {
        DeclareTiledSpriteObjectExtension(*this);

        GetObjectMetadata("TiledSpriteObject::TiledSprite").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");

        GetAllActionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::Width"].SetFunctionName("setWidth").SetGetter("getWidth").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllConditionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::Width"].SetFunctionName("getWidth").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllActionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::Height"].SetFunctionName("setHeight").SetGetter("getHeight").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllConditionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::Height"].SetFunctionName("getHeight").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllActionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::Angle"].SetFunctionName("setAngle").SetGetter("getAngle").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllConditionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::Angle"].SetFunctionName("getAngle").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllActionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::XOffset"].SetFunctionName("setXOffset").SetGetter("getXOffset").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllConditionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::XOffset"].SetFunctionName("getXOffset").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllActionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::YOffset"].SetFunctionName("setYOffset").SetGetter("getYOffset").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");
        GetAllConditionsForObject("TiledSpriteObject::TiledSprite")["TiledSpriteObject::YOffset"].SetFunctionName("getYOffset").SetIncludeFile("TiledSpriteObject/tiledspriteruntimeobject.js");

        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Exemplo n.º 6
0
    /**
     * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    TextObjectJsExtension()
    {
        DeclareTextObjectExtension(*this);

        GetObjectMetadata("TextObject::Text")
            .SetIncludeFile("TextObject/textruntimeobject.js")
            .AddIncludeFile("TextObject/textruntimeobject-pixi-renderer.js")
            .AddIncludeFile("TextObject/textruntimeobject-cocos-renderer.js");

        GetAllActionsForObject("TextObject::Text")["TextObject::String"].SetFunctionName("setString").SetGetter("getString").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllConditionsForObject("TextObject::Text")["TextObject::String"].SetFunctionName("getString").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllActionsForObject("TextObject::Text")["TextObject::Size"].SetFunctionName("setCharacterSize").SetGetter("getCharacterSize").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllConditionsForObject("TextObject::Text")["TextObject::Size"].SetFunctionName("getCharacterSize").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllActionsForObject("TextObject::Text")["TextObject::Angle"].SetFunctionName("setAngle").SetGetter("getAngle").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllConditionsForObject("TextObject::Text")["TextObject::Angle"].SetFunctionName("getAngle").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllActionsForObject("TextObject::Text")["TextObject::Opacity"].SetFunctionName("setOpacity").SetGetter("getOpacity").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllConditionsForObject("TextObject::Text")["TextObject::Opacity"].SetFunctionName("getOpacity").SetIncludeFile("TextObject/textruntimeobject.js");

        GetAllActionsForObject("TextObject::Text")["TextObject::SetBold"].SetFunctionName("setBold").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllConditionsForObject("TextObject::Text")["TextObject::IsBold"].SetFunctionName("isBold").SetIncludeFile("TextObject/textruntimeobject.js");

        GetAllActionsForObject("TextObject::Text")["TextObject::SetItalic"].SetFunctionName("setItalic").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllConditionsForObject("TextObject::Text")["TextObject::IsItalic"].SetFunctionName("isItalic").SetIncludeFile("TextObject/textruntimeobject.js");

        GetAllExpressionsForObject("TextObject::Text")["Opacity"].SetFunctionName("getOpacity").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllExpressionsForObject("TextObject::Text")["Angle"].SetFunctionName("getAngle").SetIncludeFile("TextObject/textruntimeobject.js");
        GetAllStrExpressionsForObject("TextObject::Text")["String"].SetFunctionName("getString").SetIncludeFile("TextObject/textruntimeobject.js");

        GetAllActionsForObject("TextObject::Text")["TextObject::ChangeColor"].SetFunctionName("setColor").SetIncludeFile("TextObject/textruntimeobject.js");

        //Unimplemented actions and conditions:
        GetAllActionsForObject("TextObject::Text")["TextObject::Font"].SetFunctionName("");
        GetAllActionsForObject("TextObject::Text")["TextObject::SetUnderlined"].SetFunctionName("");
        GetAllConditionsForObject("TextObject::Text")["TextObject::IsUnderlined"].SetFunctionName("");

        StripUnimplementedInstructionsAndExpressions();

        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };
Exemplo n.º 7
0
BaseObjectExtension::BaseObjectExtension()
{
    gd::BuiltinExtensionsImplementer::ImplementsBaseObjectExtension(*this);

    gd::ObjectMetadata & obj = GetObjectMetadata("");
    AddRuntimeObject(obj, "", &CreateBaseRuntimeObject);

    #if defined(GD_IDE_ONLY)
    std::map<gd::String, gd::InstructionMetadata > & objectActions = GetAllActionsForObject("");
    std::map<gd::String, gd::InstructionMetadata > & objectConditions = GetAllConditionsForObject("");
    std::map<gd::String, gd::ExpressionMetadata > & objectExpressions = GetAllExpressionsForObject("");
    std::map<gd::String, gd::ExpressionMetadata > & objectStrExpressions = GetAllStrExpressionsForObject("");

    objectConditions["PosX"].SetFunctionName("GetX").SetManipulatedType("number");
    objectActions["MettreX"].SetFunctionName("SetX").SetManipulatedType("number").SetGetter("GetX");
    objectConditions["PosY"].SetFunctionName("GetY").SetManipulatedType("number");
    objectActions["MettreY"].SetFunctionName("SetY").SetManipulatedType("number").SetGetter("GetY");
    objectActions["MettreXY"].SetFunctionName("SetXY");
    objectConditions["Angle"].SetFunctionName("GetAngle");

    objectActions["SetAngle"].SetFunctionName("SetAngle").SetManipulatedType("number").SetGetter("GetAngle");
    objectActions["Rotate"].SetFunctionName("Rotate");
    objectActions["RotateTowardAngle"].SetFunctionName("RotateTowardAngle");
    objectActions["RotateTowardPosition"].SetFunctionName("RotateTowardPosition");

    objectActions["MettreAutourPos"].SetFunctionName("PutAroundAPosition");
    objectActions["AddForceXY"].SetFunctionName("AddForce");
    objectActions["AddForceAL"].SetFunctionName("AddForceUsingPolarCoordinates");
    objectActions["AddForceVersPos"].SetFunctionName("AddForceTowardPosition");
    objectActions["AddForceTournePos"].SetFunctionName("AddForceToMoveAround");
    objectActions["Arreter"].SetFunctionName("ClearForce");
    objectActions["Delete"].SetFunctionName("DeleteFromScene");
    objectActions["ChangePlan"].SetFunctionName("SetZOrder").SetGetter("GetZOrder").SetManipulatedType("number");
    objectActions["ChangeLayer"].SetFunctionName("SetLayer");

    objectActions["ModVarObjet"].SetFunctionName("ReturnVariable").SetManipulatedType("number");
    objectActions["ModVarObjetTxt"].SetFunctionName("ReturnVariable").SetManipulatedType("string");
    objectConditions["ObjectVariableChildExists"].SetFunctionName("VariableChildExists");
    objectActions["ObjectVariableRemoveChild"].SetFunctionName("VariableRemoveChild");

    objectActions["Cache"].SetFunctionName("SetHidden");
    objectActions["Montre"].SetFunctionName("SetHidden");

    objectConditions["Plan"].SetFunctionName("GetZOrder").SetManipulatedType("number");
    objectConditions["Layer"].SetFunctionName("IsOnLayer");
    objectConditions["Visible"].SetFunctionName("IsVisible");
    objectConditions["Invisible"].SetFunctionName("IsHidden");
    objectConditions["Arret"].SetFunctionName("IsStopped");
    objectConditions["Vitesse"].SetFunctionName("TotalForceLength").SetManipulatedType("number");
    objectConditions["AngleOfDisplacement"].SetFunctionName("TestAngleOfDisplacement");
    objectConditions["VarObjet"].SetFunctionName("ReturnVariable").SetManipulatedType("number");
    objectConditions["VarObjetTxt"].SetFunctionName("ReturnVariable").SetManipulatedType("string");
    objectConditions["VarObjetDef"].SetFunctionName("VariableExists");
    objectConditions["BehaviorActivated"].SetFunctionName("BehaviorActivated");
    objectActions["ActivateBehavior"].SetFunctionName("ActivateBehavior");
    objectActions["AddForceVers"].SetFunctionName("AddForceTowardObject").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    objectActions["AddForceTourne"].SetFunctionName("AddForceToMoveAroundObject").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    objectActions["MettreAutour"].SetFunctionName("PutAroundObject").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    objectActions["Rebondir"].SetFunctionName("SeparateObjectsWithForces").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    objectActions["Ecarter"].SetFunctionName("SeparateObjectsWithoutForces").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    objectActions["SeparateFromObjects"].SetFunctionName("SeparateFromObjects").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");


    objectExpressions["X"].SetFunctionName("GetX");
    objectExpressions["Y"].SetFunctionName("GetY");
    objectExpressions["ForceX"].SetFunctionName("TotalForceX");
    objectExpressions["ForceY"].SetFunctionName("TotalForceY");
    objectExpressions["ForceAngle"].SetFunctionName("TotalForceAngle");
    objectExpressions["Angle"].SetFunctionName("GetAngle");
    objectExpressions["ForceLength"].SetFunctionName("TotalForceLength");
    objectExpressions["Longueur"].SetFunctionName("TotalForceLength");
    objectExpressions["Width"].SetFunctionName("GetWidth");
    objectExpressions["Largeur"].SetFunctionName("GetWidth");
    objectExpressions["Height"].SetFunctionName("GetHeight");
    objectExpressions["Hauteur"].SetFunctionName("GetHeight");
    objectExpressions["ZOrder"].SetFunctionName("GetZOrder");
    objectExpressions["Plan"].SetFunctionName("GetZOrder");
    objectExpressions["Distance"].SetFunctionName("GetDistanceWithObject");
    objectExpressions["SqDistance"].SetFunctionName("GetSqDistanceWithObject");
    objectExpressions["Variable"].SetFunctionName("GetVariableValue").SetStatic();
    objectStrExpressions["VariableString"].SetFunctionName("GetVariableString").SetStatic();

    GetAllActions()["Create"].SetFunctionName("CreateObjectOnScene").SetIncludeFile("GDCpp/BuiltinExtensions/RuntimeSceneTools.h");
    GetAllActions()["CreateByName"].SetFunctionName("CreateObjectFromGroupOnScene").SetIncludeFile("GDCpp/BuiltinExtensions/RuntimeSceneTools.h");
    GetAllActions()["AjoutObjConcern"].SetFunctionName("PickAllObjects").SetIncludeFile("GDCpp/BuiltinExtensions/RuntimeSceneTools.h");
    GetAllActions()["AjoutHasard"].SetFunctionName("PickRandomObject").SetIncludeFile("GDCpp/BuiltinExtensions/RuntimeSceneTools.h");
    GetAllActions()["MoveObjects"].SetFunctionName("MoveObjects").SetIncludeFile("GDCpp/BuiltinExtensions/RuntimeSceneTools.h");

    GetAllConditions()["SeDirige"].SetFunctionName("MovesToward").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    GetAllConditions()["Distance"].SetFunctionName("DistanceBetweenObjects").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    GetAllConditions()["AjoutObjConcern"].SetFunctionName("PickAllObjects").SetIncludeFile("GDCpp/BuiltinExtensions/RuntimeSceneTools.h");
    GetAllConditions()["AjoutHasard"].SetFunctionName("PickRandomObject").SetIncludeFile("GDCpp/BuiltinExtensions/RuntimeSceneTools.h");
    GetAllConditions()["PickNearest"].SetFunctionName("PickNearestObject").SetIncludeFile("GDCpp/BuiltinExtensions/RuntimeSceneTools.h");
    GetAllConditions()["NbObjet"].SetFunctionName("PickedObjectsCount").SetManipulatedType("number").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    GetAllConditions()["CollisionNP"].SetFunctionName("HitBoxesCollision").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    GetAllConditions()["EstTourne"].SetFunctionName("ObjectsTurnedToward").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");

    GetAllExpressions()["Count"].SetFunctionName("PickedObjectsCount").SetIncludeFile("GDCpp/BuiltinExtensions/ObjectTools.h");
    #endif
}
Exemplo n.º 8
0
SpriteExtension::SpriteExtension()
{
    gd::BuiltinExtensionsImplementer::ImplementsSpriteExtension(*this);

    gd::ObjectMetadata & obj = GetObjectMetadata("Sprite");
    AddRuntimeObject<gd::SpriteObject, RuntimeSpriteObject>(obj, "RuntimeSpriteObject");

    #if defined(GD_IDE_ONLY)
    obj.SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");

    std::map<gd::String, gd::InstructionMetadata > & objectActions = GetAllActionsForObject("Sprite");
    std::map<gd::String, gd::InstructionMetadata > & objectConditions = GetAllConditionsForObject("Sprite");
    std::map<gd::String, gd::ExpressionMetadata > & objectExpressions = GetAllExpressionsForObject("Sprite");

    objectActions["Opacity"].SetFunctionName("SetOpacity").SetGetter("GetOpacity").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeAnimation"].SetFunctionName("SetCurrentAnimation").SetGetter("GetCurrentAnimation").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeDirection"].SetFunctionName("SetDirection").SetGetter("GetCurrentDirectionOrAngle").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeSprite"].SetFunctionName("SetSprite").SetGetter("GetSpriteNb").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["PauseAnimation"].SetFunctionName("StopAnimation").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["PlayAnimation"].SetFunctionName("PlayAnimation").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeAnimationSpeedScale"].SetFunctionName("SetAnimationSpeedScale").SetGetter("GetAnimationSpeedScale").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["TourneVersPos"].SetFunctionName("RotateTowardPosition").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeScale"].SetFunctionName("ChangeScale").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeScaleWidth"].SetFunctionName("SetScaleX").SetGetter("GetScaleX").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeScaleHeight"].SetFunctionName("SetScaleY").SetGetter("GetScaleY").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");

    objectConditions["Animation"].SetFunctionName("GetCurrentAnimation").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["Direction"].SetFunctionName("GetCurrentDirectionOrAngle").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["Sprite"].SetFunctionName("GetSpriteNb").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["AnimStopped"].SetFunctionName("IsAnimationStopped").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["AnimationEnded"].SetFunctionName("AnimationEnded").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["ScaleWidth"].SetFunctionName("GetScaleX").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["ScaleHeight"].SetFunctionName("GetScaleY").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["Opacity"].SetFunctionName("GetOpacity").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["BlendMode"].SetFunctionName("GetBlendMode").SetManipulatedType("number").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");

    objectActions["CopyImageOnImageOfSprite"].SetFunctionName("CopyImageOnImageOfCurrentSprite").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["CreateMaskFromColorOnActualImage"].SetFunctionName("MakeColorTransparent").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeColor"].SetFunctionName("SetColor").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["ChangeBlendMode"].SetFunctionName("SetBlendMode").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");

    objectActions["FlipX"].SetFunctionName("FlipX").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectActions["FlipY"].SetFunctionName("FlipY").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["FlippedX"].SetFunctionName("IsFlippedX").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectConditions["FlippedY"].SetFunctionName("IsFlippedY").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");

    objectActions["TourneVers"].SetFunctionName("TurnTowardObject").SetIncludeFile("GDCpp/Extensions/Builtin/SpriteTools.h");

    objectExpressions["X"].SetFunctionName("GetPointX").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["Y"].SetFunctionName("GetPointY").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["PointX"].SetFunctionName("GetPointX").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["PointY"].SetFunctionName("GetPointY").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["Direc"].SetFunctionName("GetCurrentDirectionOrAngle").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["Direction"].SetFunctionName("GetCurrentDirectionOrAngle").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["Anim"].SetFunctionName("GetCurrentAnimation").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["Animation"].SetFunctionName("GetCurrentAnimation").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["Sprite"].SetFunctionName("GetSpriteNb").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["AnimationSpeedScale"].SetFunctionName("GetAnimationSpeedScale").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["ScaleX"].SetFunctionName("GetScaleX").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");
    objectExpressions["ScaleY"].SetFunctionName("GetScaleY").SetIncludeFile("GDCpp/Runtime/RuntimeSpriteObject.h");

    GetAllConditions()["Collision"].SetFunctionName("SpriteCollision").SetIncludeFile("GDCpp/Extensions/Builtin/SpriteTools.h");
    #endif
}
Exemplo n.º 9
0
    /**
     * Constructor of an extension declares everything the extension contains: objects, actions, conditions and expressions.
     */
    Extension()
    {
        DeclarePrimitiveDrawingExtension(*this);
        AddRuntimeObject(GetObjectMetadata("PrimitiveDrawing::Drawer"),
            "RuntimeShapePainterObject", CreateRuntimeShapePainterObject);

        #if defined(GD_IDE_ONLY)
        AddAction("CopyImageOnAnother",
                       _("Copy an image on another"),
                       _("Copy an image on another.\nNote that the source image must be preferably kept loaded in memory."),
                       _("Copy the image _PARAM1_ on _PARAM0_ at _PARAM2_;_PARAM3_"),
                       _("Images"),
                       "res/copy24.png",
                       "res/copyicon.png")

            .AddParameter("string", _("Name of the image to modify"))
            .AddParameter("string", _("Name of the source image"))
            .AddParameter("expression", _("X position"))
            .AddParameter("expression", _("Y position"))
            .AddParameter("yesorno", _("Should the copy take in account the source transparency\?"))
            .AddCodeOnlyParameter("currentScene", "")

            .SetFunctionName("GDpriv::PrimitiveDrawingTools::CopyImageOnAnother").SetIncludeFile("PrimitiveDrawing/PrimitiveDrawingTools.h");


        AddAction("CaptureScreen",
                       _("Capture the screen"),
                       _("Capture the screen and save it into the specified folder and/or\nin the specified image."),
                       _("Capture the screen ( Save it in file _PARAM1_ and/or in image _PARAM2_ )"),
                       _("Images"),
                       "res/imageicon24.png",
                       "res/imageicon.png")

            .AddCodeOnlyParameter("currentScene", "")
            .AddParameter("string", _("File where save capture"), "", true).SetDefaultValue("")
            .AddParameter("string", _("Name of the image where capture must be saved"), "", true).SetDefaultValue("")

            .SetFunctionName("GDpriv::PrimitiveDrawingTools::CaptureScreen").SetIncludeFile("PrimitiveDrawing/PrimitiveDrawingTools.h");

        AddAction("CreateSFMLTexture",
                       _("Create an image in memory"),
                       _("Create an image in memory."),
                       _("Create image _PARAM1_ in memory ( Width: _PARAM2_, Height: _PARAM3_, Color: _PARAM4_ )"),
                       _("Images"),
                       "res/imageicon24.png",
                       "res/imageicon.png")

            .AddCodeOnlyParameter("currentScene", "")
            .AddParameter("string", _("Name of the image"))
            .AddParameter("expression", _("Width"), "", true)
            .AddParameter("expression", _("Height"), "", true)
            .AddParameter("color", _("Initial color"), "", true).SetDefaultValue("0;0;0")

            .SetFunctionName("GDpriv::PrimitiveDrawingTools::CreateSFMLTexture").SetIncludeFile("PrimitiveDrawing/PrimitiveDrawingTools.h");

        AddAction("OpenSFMLTextureFromFile",
                       _("Open an image from a file"),
                       _("Load in memory an image from a file."),
                       _("Load in memory file _PARAM1_ inside image _PARAM2_"),
                       _("Images"),
                       "res/imageicon24.png",
                       "res/imageicon.png")

            .AddCodeOnlyParameter("currentScene", "")
            .AddParameter("file", _("File"))
            .AddParameter("string", _("Name of the image"))

            .SetFunctionName("GDpriv::PrimitiveDrawingTools::OpenSFMLTextureFromFile").SetIncludeFile("PrimitiveDrawing/PrimitiveDrawingTools.h");

        AddAction("SaveSFMLTextureToFile",
                       _("Save an image to a file"),
                       _("Save an image to a file"),
                       _("Save image _PARAM2_ to file _PARAM1_"),
                       _("Images"),
                       "res/imageicon24.png",
                       "res/imageicon.png")

            .AddCodeOnlyParameter("currentScene", "")
            .AddParameter("file", _("File"))
            .AddParameter("string", _("Name of the image"))

            .SetFunctionName("GDpriv::PrimitiveDrawingTools::SaveSFMLTextureToFile").SetIncludeFile("PrimitiveDrawing/PrimitiveDrawingTools.h");

        #endif
        GD_COMPLETE_EXTENSION_COMPILATION_INFORMATION();
    };