How to use the mcpi.settings function in mcpi

To help you get started, we’ve selected a few mcpi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arpruss / raspberryjammod-minetest / raspberryjammod / mcpipy / render.py View on Github external
self.controlFileLines.append("swapyz 0\n")
                self.controlFileLines.append("#credits Mesh by ..., copyright (c) ...\n")
                self.controlFileLines.append("yaw 0\n")
                self.controlFileLines.append("pitch 0\n")
                self.controlFileLines.append("roll 0\n")
                self.controlFileLines.append("size " + str(self.size) + "\n")
                self.controlFileLines.append("default STONE\n")
                self.controlFileLines.append("#order material position\n")
                self.controlFileLines.append("materials\n")
                self.haveMaterialArea = True
                self.endLineIndex = len(self.controlFileLines)
                self.controlFileLines.append("end\n\n")
                self.controlFileLines.append("[Insert any detailed licensing information here]")
                for line in self.controlFileLines:
                    f.write(line)
         if settings.isPE:
             self.size /= 2
github arpruss / raspberryjam-pe / p3 / scripts / lsystem.py View on Github external
def pop():
        global length
        global thickness
        length,thickness = stack.pop()
        t.pop()

    dictionary = {
        '[': push,
        ']': pop,
        '^': lambda: t.pitch(angle),
        '>': lambda: t.roll(angle),
        'f': lambda: t.go(length)
    }

    lsystem(axiom, rules, dictionary, 9 if mcpi.settings.isPE else 11)
github arpruss / raspberryjam-pe / p3 / scripts / mandelbrot.py View on Github external
#
# MIT-licensed code by Alexander Pruss
#

from mc import *
import mcpi.settings
import cmath
import time
import sys

ESCAPE = 256
if len(sys.argv) < 2:
    SIZE = 640 if not mcpi.settings.isPE else 400
else:
    SIZE = int(sys.argv[1])

if len(sys.argv) < 3:
    formula = lambda z,c : z * z + c
else:
    formula = eval('lambda z,c : '+sys.argv[2])

black = WOOL_BLACK
#palette = ( WOOL_WHITE, WOOL_ORANGE, WOOL_MAGENTA, WOOL_LIGHT_BLUE,
#            WOOL_YELLOW, WOOL_LIME, WOOL_PINK, WOOL_GRAY, WOOL_LIGHT_GRAY,
#            WOOL_CYAN, WOOL_PURPLE, WOOL_BLUE, WOOL_BROWN, WOOL_GREEN,
#            WOOL_RED, 152 )


# palette generated by solving traveling salesman problems in RGB space