Skip to content

Instantly share code, notes, and snippets.

@loudoweb
loudoweb / CompleteHaxeLimeInstall_Menu_RPi.sh
Created March 5, 2023 20:17 — forked from gepatto/CompleteHaxeLimeInstall_Menu_RPi.sh
Install Haxe,Lime and OpenFL on a Raspberry Pi running PiOS (raspbian bullseye)
#!/bin/bash
##########################################
# Gepatto 2023 #
# find me on openfl or haxe discord #
##########################################
### Color Variables ###
BLACK="\e[30m"
RED="\e[31m"
@loudoweb
loudoweb / TestScrollPreventClick.hx
Created January 29, 2023 15:19
Here is a test of the Feather UI scroller that doesn't prevent PopUpListView to open when scrolling. Because when clicking on the button, the scroller doesn't know yet it gonna scroll.
package;
import feathers.data.ArrayCollection;
import feathers.layout.VerticalLayout;
import feathers.layout.VerticalLayoutData;
import openfl.display.Sprite;
import openfl.Lib;
import feathers.events.ScrollEvent;
import feathers.controls.ScrollContainer;
import feathers.controls.PopUpListView;
@loudoweb
loudoweb / ffmpeg
Last active March 4, 2024 17:43
ffmpeg commands
//png sequence with alpha from video
ffmpeg -c:v libvpx -i myvideo.webm %02d.png
//video from png sequence
ffmpeg -framerate 30 -i image%d.png -c:v libx264 -crf 10 -b:v 1M output.mp4
ffmpeg -framerate 30 -i image%d.png -c:v libvpx -crf 10 -b:v 1M output.webm
//video from png sequence with alpha
ffmpeg -framerate 30 -i image%d.png -c:v libvpx-vp9 -pix_fmt yuva420p output.webm
//gif to webm (quality 0 to 60, lower is better)
@loudoweb
loudoweb / install_haxe_from_docker.sh
Created March 20, 2021 11:14 — forked from gepatto/install_haxe_from_docker.sh
install haxe from docker and copy to system (needs docker installed)
#!/bin/bash
# >>>>>> HELPER FUNCTIONS
function echoSection {
echo -en "\e[33m\n--------------------------------------------------------------------------------\n--\n-- " $1 "\n--\n----------------------------------------------------------------------------------\e[37m\n"
}
function echoLine {
echo -en "\e[33m\n-- " $1 "\e[37m"
}
function echoWarn {
echo -en "\e[38m\n--------------------------------------------------------------------------------\n--\n-- " $1 "\n--\n--------------------------------------------------------------------------------\e[37m\n"
Consecutives numbers sum => (max - min + 1) * (max + min) / 2
e.g: 3 + 4 + 5 + 6 = (6 - 3 + 1) * (3 + 6) / 2 = 18
*Add full stop period*
([a-zA-Z]+)]]> replace with $LAST_SUBMATCH_RESULT.]]>
Non breaking space between number and mm
([0-9]+) mm replace with $LAST_SUBMATCH_RESULT mm
Add non breaking space before :
([0-9a-zA-Z]) : replace with $LAST_SUBMATCH_RESULT :
Add non breaking space between number and word
//index.html
var video = document.createElement('video');
video.id = "videoDisplay";
video.autoPlay = false;
document.body.appendChild(video);
//yourproject.hx
#if html5
var htmlVideo:VideoElement;
htmlVideo = cast(Browser.document.getElementById('videoDisplay'), VideoElement);
/**
* OpenFL Video help file for flash/html5
* openfl=3.5.3
* lime=2.8.3
*/
//vars
var duration:Int;
var ns:NetStream;
var vid:Video;
//create video
@loudoweb
loudoweb / FixText.hx
Last active February 15, 2016 09:39
Fix font embedding issue in flash for TextField made with FlashCC/OpenFL plugin
package;
import openfl.display.DisplayObjectContainer;
import openfl.text.TextField;
/**
* ...
* @author loudo
*/
class FixText
{
@loudoweb
loudoweb / FixTile.hx
Created November 3, 2015 15:56
Fix tile trick to avoid border artifacts between tiles. #haxe #openfl
package;
/**
* Avoid holes or border artifacts between tiles.
* Sometimes the scale by 1.01 trick doesn't work, a greater value should be used. This method finds the correct value for you.
* If you use openfl_legacy, pack your atlas using reduceBorderArtifact option in TexturePacker. There is no need to use this option on openfl_next.
* You should update the scale of your tiles if your resize the screen during the game to always have the best scale value.
* @author loudo
*/
class FixTile
{