This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func get_custom_classes(): | |
#gets list of "custom" classes (defined using class_name keyword) | |
var find_this = "_global_script_classes=" | |
var custom_classes_lines = PoolStringArray() | |
var f = File.new() | |
f.open("res://project.godot", File.READ) | |
var add_lines = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func get_next_node(node): | |
var children = node.get_children() | |
if children: | |
return children[0] | |
else: | |
return _get_next_node_inner(node) | |
func _get_next_node_inner(node): | |
var node_idx = node.get_index() | |
var parent = node.get_parent() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cycle(*args, **kw): | |
d = my_getattr(cycle, 'dict', {}) | |
key = my_get(d, args, 0) | |
try: | |
res = args[key] | |
except IndexError: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
KV = """ | |
FloatLayout | |
canvas.before: | |
Color: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
KV = """ | |
Widget | |
canvas.before: | |
StencilPush | |
Color | |
rgba: 0.3, 0.2, 0.4, 1 | |
Rectangle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
from kivy.uix.widget import Widget | |
KV = """ | |
AnchorLayout | |
MyWidget | |
size_hint: 0.5,0.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
KV = """ | |
FloatLayout | |
MyEllipse | |
id:ell | |
BoxLayout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
KV = """ | |
Widget | |
size_hint: None, None | |
size: 200,200 | |
radius: [0,0,0,30] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.app import App | |
from kivy.lang import Builder | |
from kivy.uix.widget import Widget | |
from kivy.animation import Animation as A | |
KV = """ | |
AnchorLayout | |
MyWidget | |
size_hint: None, None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NonCallable: | |
#TODO: now this is a behavior, not metaclass, | |
# so msg has to refer to NonCallable | |
def __call__(self, *args, **kwargs): | |
is_root = len(self.__mro__) ==2 | |
cls_name = self.__name__ | |
type_name = type(self).__name__ |