Skip to content

Commit

Permalink
add float support to image scroll feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasTheSpaceFox committed Nov 17, 2017
1 parent 648ec9a commit f447e11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions DZU-ENG1.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ def qpop(qmsg, xpos, ypos, keyid="0", nokey="0", quyn=0, specialquit=0, fgcol=ui
hoverkey=labref.attrib.get('hoverkey', "0")
clicksoundflg=int(labref.attrib.get('sfxclick', "0"))
soundname=(labref.attrib.get('sound', "0"))
vscrollval=int(labref.attrib.get('vscroll', "0"))
hscrollval=int(labref.attrib.get('hscroll', "0"))
vscrollval=float(labref.attrib.get('vscroll', "0"))
hscrollval=float(labref.attrib.get('hscroll', "0"))
vscfl=int(labref.attrib.get('vscINT', "0"))
hscfl=int(labref.attrib.get('hscINT', "0"))
folmousehflg=int(labref.attrib.get('mouseh', "0"))
Expand All @@ -602,8 +602,8 @@ def qpop(qmsg, xpos, ypos, keyid="0", nokey="0", quyn=0, specialquit=0, fgcol=ui
hscfl=1
labref.set('hscINT', "1")
labref.set('hscINTOF', str(hscrollval))
vscoffset=int(labref.attrib.get('vscINTOF', "0"))
hscoffset=int(labref.attrib.get('hscINTOF', "0"))
vscoffset=float(labref.attrib.get('vscINTOF', "0"))
hscoffset=float(labref.attrib.get('hscINTOF', "0"))
imggfx=filelookup(imgcon)
if folmousehflg==1:
imgx=pos[0]
Expand Down Expand Up @@ -638,9 +638,9 @@ def qpop(qmsg, xpos, ypos, keyid="0", nokey="0", quyn=0, specialquit=0, fgcol=ui
#imggfx=pygame.image.load(imgcon)

if hscfl==1:
imggfx=dzulib.hscroll(hscoffset, imggfx)
imggfx=dzulib.hscroll(int(hscoffset), imggfx)
if vscfl==1:
imggfx=dzulib.vscroll(vscoffset, imggfx)
imggfx=dzulib.vscroll(int(vscoffset), imggfx)
clickref=screensurf.blit(imggfx, (imgx, imgy))
if hoverkey!="0":
if clickref.collidepoint(pos)==1:
Expand Down
2 changes: 1 addition & 1 deletion test1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ last timeout in the sequence trigger one of these.-->
<con>no-tr-animtest1a.png</con>
<act type="none"/>
</img>
<img x="500" y="100" vscroll='-2' hscroll="4">
<img x="500" y="100" vscroll='-0.2' hscroll="0.4">
<con>no-tr-animtest1a.png</con>
<act type="none"/>
</img>
Expand Down

0 comments on commit f447e11

Please sign in to comment.