Skip to content

Commit

Permalink
Themeable size and y position for flames and glows (not glow.png)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsitton committed Jun 12, 2011
1 parent 3a23d7c commit 38d07c1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/Instrument.py
Expand Up @@ -302,6 +302,11 @@ def __init__(self, engine, playerObj, player = 0):
self.keyColor = self.engine.theme.keyColor
self.key2Color = self.engine.theme.key2Color

self.hitFlameYPos = self.engine.theme.hitFlameYPos
self.hitFlameSize = self.engine.theme.hitFlameSize
self.holdFlameYPos = self.engine.theme.holdFlameYPos
self.holdFlameSize = self.engine.theme.holdFlameSize

#all flames/glows are set to there corresponding color else they are set to the fret colors
if not self.engine.theme.flamesColor == "frets":
fC = self.engine.theme.flamesColor
Expand Down Expand Up @@ -780,8 +785,9 @@ def renderHitTrails(self, controls):
f += 0.25

y = f / 6
y -= self.holdFlameYPos
x = (self.strings / 2 - n) * w
flameSize = .075
flameSize = self.holdFlameSize

if self.fretActivity[n]:
ms = math.sin(self.time) * .25 + 1
Expand Down Expand Up @@ -823,7 +829,7 @@ def renderFlames(self, song, pos, controls):
return

w = self.boardWidth / self.strings
flameSize = .075
flameSize = self.hitFlameSize

if self.starPowerActive:
flameColor = self.spColor
Expand Down Expand Up @@ -857,7 +863,7 @@ def renderFlames(self, song, pos, controls):
ff = 1 + 0.25
y = ff / 6

y -= 0.5
y -= self.hitFlameYPos

ff += 1.5 #ff first time is 2.75 after this

Expand Down Expand Up @@ -887,7 +893,7 @@ def renderFlames(self, song, pos, controls):
for step in range(4):
#draw lightning in GH themes on SP gain
if step == 0 and event.finalStar and self.spEnabled and self.hitlightning:
self.engine.draw3Dtex(self.hitlightning, coord = (xlightning, y, 3.3), rot = (90, 1, 0, 0),
self.engine.draw3Dtex(self.hitlightning, coord = (xlightning, ff / 6, 3.3), rot = (90, 1, 0, 0),
scale = (.15 + .5 * ms * ff, event.flameCount / 3.0 + .6 * ms * ff, 2), vertex = (.4,-2,-.4,2),
texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = (1,1,1))
continue
Expand Down Expand Up @@ -925,7 +931,7 @@ def renderFlames(self, song, pos, controls):
for step in range(4):
#draw lightning in GH themes on SP gain
if step == 0 and event.finalStar and self.spEnabled and self.hitlightning:
self.engine.draw3Dtex(self.hitlightning, coord = (xlightning, y, 3.3), rot = (90, 1, 0, 0),
self.engine.draw3Dtex(self.hitlightning, coord = (xlightning, ff / 6, 3.3), rot = (90, 1, 0, 0),
scale = (.15 + .5 * ms * ff, event.flameCount / 3.0 + .6 * ms * ff, 2), vertex = (.4,-2,-.4,2),
texcoord = (0.0,0.0,1.0,1.0), multiples = True, alpha = True, color = (1,1,1))
continue
Expand Down
14 changes: 13 additions & 1 deletion src/Theme.py
Expand Up @@ -179,7 +179,19 @@ def get(value, type = str, default = None):
# Separate variables for hit and hold animation frame counts.
self.HitFlameFrameLimit = get("hit_flame_frame_limit", int, 13)
self.HoldFlameFrameLimit = get("hold_flame_frame_limit", int, 16)


#controls the size of the hitflames
self.hitFlameSize = get("hit_flame_size", int, .075)

#controls the y position of the hitflames
self.hitFlameYPos = get("hit_flame_y_position", int, .3)

#controls the size of the hitflame glows
self.holdFlameSize = get("hold_flame_size", int, .075)

#controls the y position of the hitflames glows
self.holdFlameYPos = get("hold_flame_y_position", int, 0)

self.fretPress = get("fretPress", bool, False)

#Point of View (x, y, z)
Expand Down

0 comments on commit 38d07c1

Please sign in to comment.