mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-21 01:25:32 -04:00
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
/**
|
|
|
|
GDevelop - DestroyOutside Behavior Extension
|
|
Copyright (c) 2013-2016 Florian Rival (Florian.Rival@gmail.com)
|
|
This project is released under the MIT License.
|
|
*/
|
|
|
|
#ifndef DESTROYOUTSIDERUNTIMEBEHAVIOR_H
|
|
#define DESTROYOUTSIDERUNTIMEBEHAVIOR_H
|
|
#include <map>
|
|
#include "GDCpp/Runtime/Project/Object.h"
|
|
#include "GDCpp/Runtime/RuntimeBehavior.h"
|
|
class RuntimeScene;
|
|
namespace gd {
|
|
class SerializerElement;
|
|
}
|
|
|
|
/**
|
|
* \brief Behavior that allows objects to be dragged with the mouse
|
|
*/
|
|
class GD_EXTENSION_API DestroyOutsideRuntimeBehavior : public RuntimeBehavior {
|
|
public:
|
|
DestroyOutsideRuntimeBehavior(const gd::SerializerElement& behaviorContent);
|
|
virtual ~DestroyOutsideRuntimeBehavior(){};
|
|
virtual DestroyOutsideRuntimeBehavior* Clone() const {
|
|
return new DestroyOutsideRuntimeBehavior(*this);
|
|
}
|
|
|
|
/**
|
|
* \brief Return the value of the extra border.
|
|
*/
|
|
bool GetExtraBorder() const { return extraBorder; };
|
|
|
|
/**
|
|
* \brief Set the value of the extra border, i.e the supplementary margin that
|
|
* the object must cross before being deleted.
|
|
*/
|
|
void SetExtraBorder(float extraBorder_) { extraBorder = extraBorder_; };
|
|
|
|
private:
|
|
virtual void DoStepPostEvents(RuntimeScene& scene);
|
|
|
|
float extraBorder; ///< The supplementary margin outside the screen that the
|
|
///< object must cross before being deleted.
|
|
};
|
|
|
|
#endif // DESTROYOUTSIDERUNTIMEBEHAVIOR_H
|