Skip to content

Instantly share code, notes, and snippets.

@rainbowdesign
rainbowdesign / vbox.txt
Last active August 29, 2015 14:01
Virtual box and apk generation
Download the virtual hard disk file
To create an apk in the virtual machine you go to
http://kivy.org/#download
and download one of the about 1gb big files on the bottom under virtual machine.
The file you extract and remember the location of the extracted vdi file.
Download virtual Box
Then you go to
virtualbox.org
kivy
kivy/app.py
kivy/core/audio
kivy/effects/scroll.py
kivy/factory.py
kivy/graphics
kivy/lang.py
kivy/properties.pyd
kivy/uix/boxlayout.py
kivy/uix/button.py
05-05 14:23:37.441 I/ActivityManager(176): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10500000 cmp=org.test.plus/org.renpy.android.PythonActivity } from pid 176
05-05 14:23:37.551 I/ActivityManager(176): Start proc org.test.plus:python for activity org.test.plus/org.renpy.android.PythonActivity: pid=4161 uid=10107 gids={1015}
05-05 14:23:38.442 I/ActivityManager(176): Displayed org.test.plus/org.renpy.android.PythonActivity: +896ms
05-05 14:23:38.712 D/dalvikvm(4161): Trying to load lib /mnt/asec/org.test.plus-1/lib/libsdl.so 0x406ab3c8
05-05 14:23:38.712 D/dalvikvm(4161): Added shared lib /mnt/asec/org.test.plus-1/lib/libsdl.so 0x406ab3c8
05-05 14:23:38.722 D/dalvikvm(4161): Trying to load lib /mnt/asec/org.test.plus-1/lib/libsdl_image.so 0x406ab3c8
05-05 14:23:38.722 D/dalvikvm(4161): Added shared lib /mnt/asec/org.test.plus-1/lib/libsdl_image.so 0x406ab3c8
05-05 14:23:38.722 D/dalvikvm(4161): No JNI_OnLoad found in /mnt/asec/org.test.plus-1/lib/l
@rainbowdesign
rainbowdesign / c.py
Created February 7, 2014 21:55
Slideshow error
#To use it you need to put pictures into /pictures/
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition, SwapTransition,WipeTransition
from kivy.uix.image import AsyncImage
from kivy.uix.boxlayout import BoxLayout
import kivy
from kivy.uix.widget import Widget
from kivy.app import App
import os, glob
from kivy.lang import Builder
@rainbowdesign
rainbowdesign / b.py
Last active August 29, 2015 13:56
Webdebugger
import kivy
from kivy.uix.widget import Widget
from kivy.app import App
from kivy.lang import Builder
from kivy.loader import Loader
kvs1='''
BoxLayout:
orientation: 'vertical'
@rainbowdesign
rainbowdesign / a.py
Created February 6, 2014 20:03
Reoccuring crash
[WARNING ] [WinPygame ] Video: failed (multisamples=2)
[WARNING ] [WinPygame ] trying without antialiasing
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "C:\Kivy\nstar\recent version\merger.py", line 27, in <module>
execfile('northernstar.py')
File "northernstar.py", line 1946, in <module>
MainApp().run()
File "C:\Kivy\kivy\kivy\app.py", line 779, in run
dmap = FloatLayout(size_hint=(None, None), width = width, height = height)
dmap2 = GridLayout(size_hint=(None, None), cols=10, spacing=0, width = width, height = height)
for x in range (10):
for y in range(10):
z = x*y
dmapbtt = Button(text=str(z))
dmap2.add_widget(dmapbtt)
#with dmap.canvas.before:
# Rectangle(source=image_file,size = (width,height))
dmap.add_widget(dmap2)
@rainbowdesign
rainbowdesign / res.py
Last active August 29, 2015 13:56
Resize image
# the + and - butten are suposed to resize the canvas and its content but it does not change the size. print width gives the
# wanted width dmmod is correct but it seems not applied.
# please just comment here.
def dugimg():
image_file = "images/dugeons/lapin_kulta.jpg"
img = Image.open(image_file)
# get the image's width and height in pixels
width, height = img.size
#Please help me to return the right list.
x = [['magic','fireball','Powerful firemagic that hits all enemys one time','fire.png'],[], [[[[['phy'],'hp', '!!!!']]]]]
def parseop(tmpsp):
for num, nam in enumerate (tmpsp):
if type(nam) == list:
parseop(tmpsp[num])
if nam=='!!!!': # do something
print 'parseop2', nam
nam = 'success'
@rainbowdesign
rainbowdesign / battlecalc.py
Last active January 4, 2016 08:09
Battlecalculator
#target: replace the ifa / arg section with numpy or something else
spell = ([['magic','black hole', [[['mag'],'hp', ['mul', -0.20,'hpt' ]], [['mag'],'mana',['mul', -0.20, 'manat']]]]])
def battlecal(caster, spell, target, spexe = 0, targetarray=0, targetx=0,targety=0, remove=0):
print (('spell',spell))
if type(spell) is str:
spell = copy.deepcopy(extraspells[spell])
if type(spell) is list: