Skip to content

Instantly share code, notes, and snippets.

from kivy.app import App
from kivy.app import Builder
from kivy.uix.stacklayout import StackLayout
from kivy.uix.button import Button
Builder.load_string("""
#:set RED (1, 0, 0, 1)
#:set GREEN (0, 1, 0, 1)
#:set BLUE (0, 0, 1, 1)
@Alan-FGR
Alan-FGR / kv_eval_problem.py
Last active July 7, 2016 14:51
If you uncomment the code on line 15, it works properly
from kivy.app import App
from kivy.app import Builder
from kivy.uix.stacklayout import StackLayout
from kivy.uix.label import Label
from kivy.uix.button import Button
from kivy.properties import NumericProperty
Builder.load_string("""
@Alan-FGR
Alan-FGR / Quads.cs
Created November 9, 2016 18:12
Trying to render quads in Atomic
using System;
using AtomicEngine;
public class GameRoot : AppDelegate
{
private Texture2D sprite;
public override void Start()
{
var graphics = AtomicNET.GetSubsystem<Graphics>();
using System;
using AtomicEngine;
//################ Render.xml
//<renderpath>
// <command type="sendevent"/>
//</renderpath>
public class Program
{
@Alan-FGR
Alan-FGR / HelloAtomic.cs
Created November 10, 2016 12:10
Black Screen of Despair in Simple Atomic Example
using AtomicEngine;
public class GameRoot : AppDelegate
{
public override void Start()
{
// We will be needing to load resources.
// All the resources used in this example comes with Urho3D.
// If the engine can't find them, check the ResourcePrefixPath.
var cache = GetSubsystem<ResourceCache>();
@Alan-FGR
Alan-FGR / HelloQuadWithUI.cs
Created November 12, 2016 04:02
Rendering and UI in Atomic Engine
using AtomicEngine;
public class Program
{
public static void Main(string[] args)
{
Application.Run<HelloQuadWithUI>(args);
}
}
@Alan-FGR
Alan-FGR / plot.py
Created November 19, 2016 13:35
Totally Fine Readable Descriptive High-Quality Code
def plot(titl,xvals,yvals,xl,yl,pxw=720,pxh=450,dpi=80,xts=4,yts=1,inv=False):
from matplotlib import pyplot as plt; import matplotlib as mpl;
plt.style.use('seaborn-bright');
fig = plt.figure(figsize=(pxw/dpi, pxh/dpi), dpi=dpi, facecolor='w')
fig.subplots_adjust(left=.08, bottom=.1, right=.95, top=.92)
ax = fig.add_subplot(111); ax.minorticks_on()
ax.get_xaxis().set_minor_locator(mpl.ticker.AutoMinorLocator(xts))
ax.get_yaxis().set_minor_locator(mpl.ticker.AutoMinorLocator(yts))
ax.grid(b=True, which='minor',alpha=0.07,linestyle='-')
ax.grid(b=True, which='major',alpha=0.21,linestyle='-')
1>------ Build started: Project: GenerateScriptBindings, Configuration: Release x64 ------
1> Building Custom Rule C:/_AtomicTest192/AtomicGameEngine/Source/AtomicTool/CMakeLists.txt
1> CMake does not need to re-run because C:\_AtomicTest192\AtomicGameEngine-VS2015\Source\AtomicTool\CMakeFiles\generate.stamp is up-to-date.
1> TSLINT: Linting files in {./Script/AtomicEditor/**/*.ts,./Script/AtomicWebViewEditor/**/*.ts}
1> TSLINT: WARNING - Lint errors detected
1> Script/AtomicEditor/resources/ProjectTemplates.ts[164, 11]: missing semicolon
1> Script/AtomicEditor/resources/ResourceOps.ts[39, 149]: missing semicolon
1> Script/AtomicEditor/resources/ResourceOps.ts[81, 26]: missing semicolon
1> Script/AtomicEditor/resources/ResourceOps.ts[98, 14]: missing semicolon
1> Script/AtomicEditor/ui/frames/HierarchyFrame.ts[92, 1]: trailing whitespace
//
// Copyright (c) 2008-2016 the Urho3D project.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
(((1 << i) & checkMask) | ((1 << next) & checkMask)) != ((1 << i) | (1 << next))
((1 << i) & checkMask) != 0 && ((1 << next) & checkMask) == 0 || ((1 << i) & checkMask) == 0 && ((1 << next) & checkMask) != 0