Add Show Mouse node

This commit is contained in:
unknown 2018-05-16 12:17:16 +02:00
parent a2bf6a0a90
commit 310cf140b8
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,15 @@
package armory.logicnode;
class ShowMouseNode extends LogicNode {
public function new(tree:LogicTree) {
super(tree);
}
override function run() {
var show:Bool = inputs[1].get();
var mouse = iron.system.Input.getMouse();
show ? mouse.show() : mouse.hide();
super.run();
}
}

View file

@ -0,0 +1,17 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class ShowMouseNode(Node, ArmLogicTreeNode):
'''Show Mouse node'''
bl_idname = 'LNShowMouseNode'
bl_label = 'Show Mouse'
bl_icon = 'GAME'
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('NodeSocketBool', 'Show')
self.outputs.new('ArmNodeSocketAction', 'Out')
add_node(ShowMouseNode, category='Input')