Keyframes showing up, selectable

This commit is contained in:
Skyler Lehmkuhl 2012-01-05 15:22:02 -05:00
parent 6d81c8e953
commit f8391687a5
2 changed files with 11 additions and 3 deletions

View File

@ -31,6 +31,7 @@ def onLoadFrames(self):
def onClickFrame(self, x, y):
print x, int(x/16)
root.descendItem().activeframe = int(x/16)
MainWindow.stage.draw()
def onMouseDownGroup(self, x, y):
if svlgui.MODE in [" ", "s"]:
if self.hitTest(x, y):
@ -112,7 +113,7 @@ def create_sc(root):
def run_file(self=None):
global root
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):

View File

@ -786,7 +786,7 @@ class Image(object):
(src_rect[3]/self.vtiles)*(self.pointer/self.htiles+1)]
#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]
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)
else:
src_rect = self.image.bounds
@ -1026,11 +1026,16 @@ class Layer:
pass
def onKeyUp(self, self1, key):
pass
def getcurrentselect(self):
return self.frames[self.currentframe].currentselect
def setcurrentselect(self, val):
self.frames[self.currentframe].currentselect = val
minx = property(getminx)
miny = property(getminy)
maxx = property(getmaxx)
maxy = property(getmaxy)
scale = property(fset = setscale)
currentselect = property(getcurrentselect, setcurrentselect)
class frame:
class framewrapper (object):
#Wraps object per-frame. Allows for changes in position, rotation, scale.
@ -1184,7 +1189,6 @@ class Layer:
self.level = False
self.clicked = False
self.hidden = False
self.currentselect = None
def parse_obj(obj):
self.objs.append(obj)
obj.x=obj.x-self.x
@ -1350,6 +1354,9 @@ class Group (object):
def getactiveframe(self):
return self.activelayer.activeframe
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
minx = property(getminx)
miny = property(getminy)