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
| # This is a function for capturing screenshots with GDScript | |
| func screenshot(): | |
| # Capture the screenshot | |
| var size = OS.window_size | |
| var image = get_viewport().get_texture().get_data() | |
| # Setup path and screenshot filename | |
| var date = OS.get_datetime() | |
| var path = "user://screenshots" | |
| var file_name = "screenshot-%d-%02d-%02dT%02d:%02d:%02d" % [date.year, date.month, date.day, date.hour, date.minute, date.second] |
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
| # Loads a scene in the background using a seperate thread and a queue. | |
| # Foreach new scene there will be an instance of ResourceInteractiveLoader | |
| # that will raise an on_scene_loaded event once the scene has been loaded. | |
| # Hooking the on_progress event will give you the current progress of any | |
| # scene that is being processed in realtime. The loader also uses caching | |
| # to avoid duplicate loading of scenes and it will prevent loading the | |
| # same scene multiple times concurrently. | |
| # | |
| # Sample usage: | |
| # |
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
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| """Example code for a PyQt image-display widget which Just Works™ | |
| TODO: Split this into a loader wrapper and a widget wrapper so it can be used | |
| in designs which maintain a preloaded queue of upcoming images to improve | |
| the perception of quick load times. | |
| """ | |
| from __future__ import (absolute_import, division, print_function, |
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
| import argparse | |
| import os | |
| from PIL import Image | |
| parser = argparse.ArgumentParser( | |
| description='Convert GIF into frames and then create ' | |
| 'AnimatedTexture .tres') | |
| parser.add_argument('gif', help='GIF to process') | |
| args = parser.parse_args() |
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
| extends Node2D | |
| var timeToShow = 5 | |
| var originalPosition | |
| var waveDelay = 0 | |
| var isWavy = false | |
| var wavyDirection = 1 | |
| var isShakey = 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
| function Mount (rider,horse) | |
| --for k,horse in pairs(unit_list) do | |
| --if unit_rider.pos.x==horse.pos.x and unit_rider.pos.y==horse.pos.y | |
| --and unit_rider.pos.z==horse.pos.z then --check if they are on the same tile | |
| horse.general_refs:insert("#",{new=df.general_ref_unit_riderst,unit_id=rider.id}) | |
| rider.relations.rider_mount_id=horse.id | |
| rider.flags1.rider=true | |
| horse.flags1.ridden=true | |
| require("utils").insert_sorted(df.global.world.units.other.ANY_RIDER,rider,"id") | |
| return |