Keyframes showing up, selectable
This commit is contained in:
parent
6d81c8e953
commit
f8391687a5
|
|
@ -31,6 +31,7 @@ def onLoadFrames(self):
|
||||||
def onClickFrame(self, x, y):
|
def onClickFrame(self, x, y):
|
||||||
print x, int(x/16)
|
print x, int(x/16)
|
||||||
root.descendItem().activeframe = int(x/16)
|
root.descendItem().activeframe = int(x/16)
|
||||||
|
MainWindow.stage.draw()
|
||||||
def onMouseDownGroup(self, x, y):
|
def onMouseDownGroup(self, x, y):
|
||||||
if svlgui.MODE in [" ", "s"]:
|
if svlgui.MODE in [" ", "s"]:
|
||||||
if self.hitTest(x, y):
|
if self.hitTest(x, y):
|
||||||
|
|
@ -112,7 +113,7 @@ def create_sc(root):
|
||||||
def run_file(self=None):
|
def run_file(self=None):
|
||||||
global root
|
global root
|
||||||
print "RUNNING"
|
print "RUNNING"
|
||||||
#open("../Desktop/test.sc", "w").write(create_sc(root))
|
open("/Users/skyler/Desktop/test.sc", "w").write(create_sc(root))
|
||||||
|
|
||||||
|
|
||||||
def box(x, y, width, height, fill=None):
|
def box(x, y, width, height, fill=None):
|
||||||
|
|
|
||||||
11
svlgui.py
11
svlgui.py
|
|
@ -786,7 +786,7 @@ class Image(object):
|
||||||
(src_rect[3]/self.vtiles)*(self.pointer/self.htiles+1)]
|
(src_rect[3]/self.vtiles)*(self.pointer/self.htiles+1)]
|
||||||
#src_rect = [16*self.pointer,0,16+16*self.pointer,32]
|
#src_rect = [16*self.pointer,0,16+16*self.pointer,32]
|
||||||
#print [self.x, self.y, self.x+self.image.bounds[2]/self.htiles, self.y+self.image.bounds[3]/self.vtiles]
|
#print [self.x, self.y, self.x+self.image.bounds[2]/self.htiles, self.y+self.image.bounds[3]/self.vtiles]
|
||||||
dst_rect = [0, 0, self.image.bounds[2]/self.htiles, self.image.bounds[3]/self.vtiles]
|
dst_rect = [self.x, self.y, self.image.bounds[2]/self.htiles+self.x, self.image.bounds[3]/self.vtiles+self.y]
|
||||||
self.image.draw(cr, src_rect, dst_rect)
|
self.image.draw(cr, src_rect, dst_rect)
|
||||||
else:
|
else:
|
||||||
src_rect = self.image.bounds
|
src_rect = self.image.bounds
|
||||||
|
|
@ -1026,11 +1026,16 @@ class Layer:
|
||||||
pass
|
pass
|
||||||
def onKeyUp(self, self1, key):
|
def onKeyUp(self, self1, key):
|
||||||
pass
|
pass
|
||||||
|
def getcurrentselect(self):
|
||||||
|
return self.frames[self.currentframe].currentselect
|
||||||
|
def setcurrentselect(self, val):
|
||||||
|
self.frames[self.currentframe].currentselect = val
|
||||||
minx = property(getminx)
|
minx = property(getminx)
|
||||||
miny = property(getminy)
|
miny = property(getminy)
|
||||||
maxx = property(getmaxx)
|
maxx = property(getmaxx)
|
||||||
maxy = property(getmaxy)
|
maxy = property(getmaxy)
|
||||||
scale = property(fset = setscale)
|
scale = property(fset = setscale)
|
||||||
|
currentselect = property(getcurrentselect, setcurrentselect)
|
||||||
class frame:
|
class frame:
|
||||||
class framewrapper (object):
|
class framewrapper (object):
|
||||||
#Wraps object per-frame. Allows for changes in position, rotation, scale.
|
#Wraps object per-frame. Allows for changes in position, rotation, scale.
|
||||||
|
|
@ -1184,7 +1189,6 @@ class Layer:
|
||||||
self.level = False
|
self.level = False
|
||||||
self.clicked = False
|
self.clicked = False
|
||||||
self.hidden = False
|
self.hidden = False
|
||||||
self.currentselect = None
|
|
||||||
def parse_obj(obj):
|
def parse_obj(obj):
|
||||||
self.objs.append(obj)
|
self.objs.append(obj)
|
||||||
obj.x=obj.x-self.x
|
obj.x=obj.x-self.x
|
||||||
|
|
@ -1350,6 +1354,9 @@ class Group (object):
|
||||||
def getactiveframe(self):
|
def getactiveframe(self):
|
||||||
return self.activelayer.activeframe
|
return self.activelayer.activeframe
|
||||||
def setactiveframe(self, frame):
|
def setactiveframe(self, frame):
|
||||||
|
print self.activelayer.frames
|
||||||
|
if frame<len(self.activelayer.frames) and self.activelayer.frames[frame]:
|
||||||
|
self.activelayer.currentframe = frame
|
||||||
self.activelayer.activeframe = frame
|
self.activelayer.activeframe = frame
|
||||||
minx = property(getminx)
|
minx = property(getminx)
|
||||||
miny = property(getminy)
|
miny = property(getminy)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue