Skip to content

Instantly share code, notes, and snippets.

View henriquelalves's full-sized avatar

Henrique Lacreta Alves henriquelalves

View GitHub Profile
Assignment 3:
Headlines -> Vectors -> Groups
\_________ ________/
v
the complicated
part
Baseline idea:
- Bag of Words (BoW)
@henriquelalves
henriquelalves / main.js
Created April 20, 2017 18:21
Phaser-Input endFocus callback
input = game.add.inputField(10, 90, style);
input.stateRef = this;
input.isEditting = false;
(function (i){
var oldStartFocus = i.startFocus;
i.startFocus = function (){
console.log("Start");
@henriquelalves
henriquelalves / .py
Created March 22, 2017 13:52
quickfix on plugin node deselection
func forward_input_event(event):
if event.type == InputEvent.MOUSE_BUTTON:
if event.button_index == BUTTON_LEFT and get_selection().get_selected_nodes().size() == 0:
make_visible(false)
return false
func make_visible(visible):
if visible:
dock.show()
else:
@henriquelalves
henriquelalves / gist:d1f687d7e73527762098921c1f116403
Created May 20, 2016 20:21
Recursive search for viewport on Godot
func find_viewport(node, recursive_level):
if node.get_type() == "CanvasItemEditor":
return node.get_child(1).get_child(0).get_child(1).get_child(1)
else:
recursive_level += 1
if recursive_level > 15:
return null
for child in node.get_children():
var result = find_viewport(child, recursive_level)
if result != null:
@henriquelalves
henriquelalves / gist:97ebdf271f25cd3d5d25
Last active March 5, 2016 04:32
Godot_issue_printing_addon
#CUSTOM_DOCK.GD
tool
extends VBoxContainer
# member variables here, example:
# var a=2
# var b="textvar"
func _ready():
# Called every time the node is added to the scene.
@henriquelalves
henriquelalves / fisheyeeffect
Last active August 14, 2021 09:45
Godot Shader for FishEye 2D effect
// Based on http://www.geeks3d.com/20140213/glsl-shader-library-fish-eye-and-dome-and-barrel-distortion-post-processing-filters/2/
float PI = 3.1415926535;
uniform float BarrelPower;
vec2 distort(vec2 p) {
if(p.x > 0.0){
float angle = p.y / p.x;
float theta = atan(angle);
<?xml version="1.0" encoding="UTF-8" ?>
<resource_file type="CanvasItemShaderGraph" subresource_count="1" version="2.0" version_name="Godot Engine v2.0.rc1.custom_build">
<main_resource>
<dictionary name="_code" shared="false">
<string> "fragment" </string>
<string> "vec3 nd1sl2=vec3(UV,0);&#000a;float nd6sl0=nd1sl2.x;&#000a;float nd6sl1=nd1sl2.y;&#000a;float nd6sl2=nd1sl2.z;&#000a;float nd2sl0=TIME;&#000a;float nd3sl0=fract(nd2sl0);&#000a;float nd4sl0=max(nd3sl0,nd6sl1);&#000a;float nd5sl0=min(nd3sl0,nd6sl1);&#000a;float nd7sl0=nd4sl0-nd5sl0;&#000a;float nd8sl1def=0.01;&#000a;float nd8sl0=min(nd7sl0,nd8sl1def);&#000a;float nd9sl1def=100;&#000a;float nd9sl0=nd8sl0*nd9sl1def;&#000a;float nd12sl0=nd9sl0*nd6sl1;&#000a;vec3 nd10sl0=vec3(nd6sl0,nd12sl0,nd6sl2);&#000a;vec4 rt_default_tex11=tex(TEXTURE,nd10sl0.xy);&#000a;vec3 nd11sl0=rt_default_tex11.rgb;&#000a;float nd11sl1=rt_default_tex11.a;&#000a;COLOR.rgb=nd11sl0;&#000a;" </string>
<string> "fragment_ofs" </string>
<int> 0 </int>
<string> "lig
"Wisdom comes alone through suffering." - AESCHYLUS.
"I sacrifice to no god save myself — And to my belly, greatest of deities." - EURIPEDES.
"Life is pleasant. Death is peaceful. It's the transition that's troublesome." - ASIMOV, Isaac.
"Self-education is, I firmly believe, the only kind of education there is." - ASIMOV, Isaac.
"Oh, I'm just too good for my own bad self. Hello Earth. Who's your daddy? Why, yes, I am." - SCHWING, Schwang (MDK2).
"The best way out is always through." - FROST, Robert.
("It's not possible.") "No, it's necessary." - COOPER (Interestellar).
"There are no two words in the english language more harmful than 'Good Job'." - FLETCHER (Whiplash).
“If my doctor told me I had only six minutes to live, I wouldn't brood. I'd type a little faster.” - ASIMOV, Isaac.
"The right man in the wrong place can make all the difference in the world. So, wake up, Mister Freeman. Wake up and... smell the ashes." - G-MAN (Half-life 2).