Well I tried with both, and CustomDisplayable seemed slightly faster, but still the game is unplayable even on a fairly new android tablet
Code: Select all
init python:
class MapDisplayable(renpy.Displayable):
def __init__(self, **properties):
renpy.Displayable.__init__(self, **properties)
# The child.
# self.child = renpy.displayable(child)
# The distance at which the child will become fully opaque, and
# where it will become fully transparent. The former must be less
# than the latter.
# self.opaque_distance = opaque_distance
# self.transparent_distance = transparent_distance
# The alpha channel of the child.
self.alpha = 1.0
# The width and height of us, and our child.
self.width = 1280
self.height = 720
def render(self, width, height, st, at):
r = renpy.Render(width, height)
ofx=0;ofy=0;sfx=578;sfy=4
for x in range(MyMapsize):
ofx=sfx;ofy=sfy
for y in range(MyMapsize):
img=("tile%s" % (MyMap[x][y]))
if Is_Night and img not in tilenotint:
try:
img=im.MatrixColor(ImageReference(img),im.matrix.tint(Ir,Ig,Ib)*im.matrix.saturation(Is)*im.matrix.brightness(Il))
except:
pass
if Is_Dusk:
try:
img=im.MatrixColor(ImageReference(img),im.matrix.tint(.9,.9,1.0)*im.matrix.saturation(.9)*im.matrix.brightness(-.1))
except:
pass
r.blit(renpy.render(ImageReference(img), width, height, st, at), (ofx,ofy))
ofy+=32;ofx+=64
sfx-=64;sfy+=32
return r
#screen ShowMap:
# add "main/mainbase.jpg"
# add MapDisplayable()
screen ShowMapHotSpots:
default mapinfo=False
default cval1=99
default cval2=99
default MTiles=False
default MArrows=True
# key "-" action MinusVar
# key "+" action PlusVar
# key "v" action ChangeVar
key "K_F2" action ToggleScreenVariable("mapinfo")
key "K_F3" action ToggleVariable("Is_Night")
# key "m" action ToggleScreenVariable("MTiles")
# key "n" action ToggleScreenVariable("MArrows")
# add "main/mainbase.jpg"
# #text ("R:%s G:%s B:%s Sat:%s Lum:%s CurVar:%s" % (Ir,Ig,Ib,Is,Il,CurVar)) outlines [(2,"#000")]
# add MapDisplayable()
if MTiles or config.developer:
#draw the map
$ofx=0;ofy=0;sfx=578;sfy=4
for x in range(MyMapsize):
$ofx=sfx;ofy=sfy
for y in range(MyMapsize):
# $img=("tile%s" % (MyMap[x][y]))
# if Is_Night and img not in tilenotint:
# python:
# try:
# img=im.MatrixColor(ImageReference(img),im.matrix.tint(Ir,Ig,Ib)*im.matrix.saturation(Is)*im.matrix.brightness(Il))
# except:
# pass
# add (img) xpos (ofx) ypos (ofy)
if mapinfo:
text ("%s,%s" % (x,y)) xpos (ofx+48) ypos (ofy+60) size 12 outlines [(1,"#000")]
text ("%s" % MyMap[x][y]) xpos (ofx+48) ypos (ofy+80) size 12 outlines [(1,"#000")]
#imagebutton idle (im.MatrixColor("cursor.png",im.matrix.opacity(0.5))) hover ("cursor.png") focus_mask True action Return() xpos (ofx) ypos (ofy)
$ofy+=32;ofx+=64
$sfx-=64;sfy+=32
if "touch" in config.variants:
button:
xfill True yfill True background None
action (SetScreenVariable("cval1",99),Hide("InfoBox"))
activate_sound None
if not temp_map:
#map stats
hbox xalign .8 ypos 10 spacing 10:
button background None xpadding 0 ypadding 0:
vbox:
add (Frame("map/quest_big.png",1,1,xmaximum=64,ymaximum=64))
text ("%s/%s" % (map_quests[cur_season],max_quests[cur_season])) size 20 outlines [(2,"#1e1a16")] font "Stoke-Regular.ttf" xcenter .5
action Show("MsgBox",msg="This is the total number of quests available in this Season. Besides the main plot quest, there are several sidequests of varying difficulty/length available. Find and solve them all to get more EXP points!",msgtitle="Total Quests")
button background None xpadding 0 ypadding 0:
vbox:
add (Frame("map/location_big.png",1,1,xmaximum=64,ymaximum=64))
text ("%s/%s" % (map_locations[cur_season],max_locations[cur_season])) size 20 outlines [(2,"#1e1a16")] font "Stoke-Regular.ttf" xcenter .5
action Show("MsgBox",msg="Each Season has a number of locations to unearth. Some are fairly obvious and visible, while others are harder to find, but could yield interesting rewards. Discover all the locations in a Season to earn bonus EXP!",msgtitle="Undiscovered Locations")
button background None xpadding 0 ypadding 0:
vbox:
add (Frame("map/fame_big.png",1,1,xmaximum=64,ymaximum=64))
#text ("%s/%s" % (map_fame[cur_season],max_fame[cur_season])) size 20 outlines [(2,"#1e1a16")] font "Stoke-Regular.ttf" xcenter .5
text ("%s") % (map_fame[cur_season]) size 20 outlines [(2,"#1e1a16")] font "Stoke-Regular.ttf" xcenter .5
action Show("MsgBox",msg="Fame indicates how much people know about you and your deeds. This value increases as you complete quests, and defeat dangerous opponents. Fame relates to this Season only, and will not carry over to the next Season. High fame will lead to discounts in shops, and other sorts of favors from people.",msgtitle="Party Fame")
if MArrows:
#draw hotspots
$ofx=0;ofy=0;sfx=580;sfy=4
for x in range(MyMapsize):
$ofx=sfx;ofy=sfy
for y in range(MyMapsize):
for mapN,mt,mx,my,type,desc,par,arrowC,fTile in maps:
if mapN==map_zone and x==mx and y==my and eval(mt):
#autofix edge movement arrows!
if arrowC=="green":
if mx==9:
$arrowC="W"
if mx==0:
$arrowC="E"
if my==9:
$arrowC="S"
if my==0:
$arrowC="N"
#if mobile
if "touch" in config.variants:
button background None bottom_padding 30 xpos (ofx+64) ypos (ofy+48) at Boing():
add ("map/%s.png" % arrowC)
action If(cval1==mx and cval2==my, (Hide("InfoBox"),Return([type,desc,par])), (Show("InfoBox",x=ofx+64,y=ofy+48,type=type,desc=desc,par=par),SetScreenVariable("cval1",mx),SetScreenVariable("cval2",my)) )
else:
button background None bottom_padding 30 xpos (ofx+64) ypos (ofy+48) at Boing():
add ("map/%s.png" % arrowC)
hovered Show("InfoBox",x=ofx+64,y=ofy+48,type=type,desc=desc,par=par)
unhovered Hide("InfoBox")#,transition=quickdissolve)
action (Hide("InfoBox"),Return([type,desc,par]))
#display party position ?
if showpartyposition and x==pax and y==pay:
add ("map/party_%s.png" % partyposname) xpos (ofx+64) ypos (ofy+48) at Rotor()
$ofy+=32;ofx+=64
$sfx-=64;sfy+=32
#Info
vbox xpos 10 ypos 0 spacing -2:
text map_name[map_zone] size (75-len(map_name[map_zone])) outlines [(2,"#1e1a16")] font "BerkshireSwash-Regular.ttf"
text ("Day %d, %s" % (CurDay,Seasons[CurSeason])) color "#DDD" size 32 outlines [(2,"#1e1a16")] font "BerkshireSwash-Regular.ttf"
if not temp_map:
text ("Days to next plot event: {color=#FF0}%02d{/color}" % Dday) size 22 outlines [(2,"#1e1a16")] font "Stoke-Regular.ttf"
if not temp_map:
#display party
hbox xpos 4 yalign 1.0 spacing 4:
$c=0
for entry in party.dragCharacters:
$img="gfx/gui/unlearnedSkill.png"
if entry.character in party.available:
if entry.character.isAlive():
$img="gfx/gui/learnedSkill.png"
else:
$img="gfx/gui/unlearnedSkill.png"
$a=1#.25
if entry.character in party.party:
$a=1
vbox:
button:
background Frame(img,8,8,tile=True)
xmaximum 96 ymaximum 90 xminimum 96 yminimum 90 xmargin 0 ymargin 0 xpadding 4 top_padding 4 bottom_padding 5
bar value (entry.character.hp) range (entry.character.getValue("HP")) style "hpbar" xalign 0.025 yalign 1.0 thumb None bar_vertical True
bar value (entry.character.sp) range (entry.character.getValue("SP")) style "spbar" xalign 1.0 yalign 1.0 thumb None bar_vertical True
$img2="gfx/portraits/p_%s.png" % entry.character.name
if entry.character.isAlive():
add (img2) xcenter .5 alpha (a) zoom .75 yalign .9
else:
add (im.Grayscale(img2)) xcenter .5 alpha (a) zoom .75 yalign .9
action (SetField(party,"gui_selected_char",entry.character),Show("Char_Screen_Main"))
frame ymaximum 24 xminimum 96 xcenter .5 ypadding 10 xpadding 15:
background Frame(img,8,8,tile=True)
text entry.character.name size 13 xcenter .5
else:
vbox:
button:
background Frame(img,8,8,tile=True)
xmaximum 96 ymaximum 90 xminimum 96 yminimum 90 xmargin 0 ymargin 0 xpadding 4 top_padding 4 bottom_padding 5
text "?" size 40 xcenter .5 ycenter .5
# bar value (entry.character.hp) range (entry.character.getValue("HP")) style "hpbar" xalign 0.025 yalign 1.0 thumb None bar_vertical True
# bar value (entry.character.sp) range (entry.character.getValue("SP")) style "spbar" xalign 1.0 yalign 1.0 thumb None bar_vertical True
frame ymaximum 24 xminimum 96 xcenter .5 ypadding 10 xpadding 15:
background Frame(img,8,8,tile=True)
text " " size 13 xcenter .5
$c+=1
if c==4:
null width 472
use OnScreen_Menu