getContainer added across floating space

This commit is contained in:
Luis Fernando Molina committed 2019-05-04 18:06:21 +02:00
1 parent 7115daf686
commit 276db501b6
7 files changed
+118 -9

No files matched your search

+24 -1
View File
@@ -54,11 +54,21 @@ function newFloatingObject () {
linkedObject: undefined, // This is a reference to the object that this floating object is representing.
linkedObjectType: '', // Since there might be floating objects for different types of objects, here we store the type of object we are linking to.
container: undefined, // This is a pointer to the object where the floating object belongs to.
getContainer: getContainer,
container: undefined,
initialize: initialize
}
thisObject.container = newContainer()
thisObject.container.name = MODULE_NAME
thisObject.container.initialize('Circle')
thisObject.container.isClickeable = true
thisObject.container.isDraggeable = false
thisObject.container.frame.radius = 0
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
thisObject.eventHandler = newEventHandler()
return thisObject
@@ -110,6 +120,19 @@ function newFloatingObject () {
}
}
function getContainer (point) {
let container
container = thisObject.underlayingObject.getContainer(point)
if (container !== undefined) { return container }
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
return thisObject.container
} else {
return undefined
}
}
function physicsLoop (callBackFunction) {
try {
if (INFO_LOG === true) { logger.write('[INFO] initialize -> Entering function.') }