mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Updated Power Green fonts, repositioned all text accordingly
This commit is contained in:
@@ -4,11 +4,14 @@ module MessageConfig
|
||||
DARK_TEXT_MAIN_COLOR = Color.new(80, 80, 88)
|
||||
DARK_TEXT_SHADOW_COLOR = Color.new(160, 160, 168)
|
||||
FONT_NAME = "Power Green"
|
||||
FONT_SIZE = 29
|
||||
FONT_SIZE = 27
|
||||
FONT_Y_OFFSET = 8
|
||||
SMALL_FONT_NAME = "Power Green Small"
|
||||
SMALL_FONT_SIZE = 25
|
||||
SMALL_FONT_SIZE = 21
|
||||
SMALL_FONT_Y_OFFSET = 8
|
||||
NARROW_FONT_NAME = "Power Green Narrow"
|
||||
NARROW_FONT_SIZE = 29
|
||||
NARROW_FONT_SIZE = 27
|
||||
NARROW_FONT_Y_OFFSET = 8
|
||||
# 0 = Pause cursor is displayed at end of text
|
||||
# 1 = Pause cursor is displayed at bottom right
|
||||
# 2 = Pause cursor is displayed at lower middle side
|
||||
@@ -408,18 +411,21 @@ end
|
||||
def pbSetSystemFont(bitmap)
|
||||
bitmap.font.name = MessageConfig.pbGetSystemFontName
|
||||
bitmap.font.size = MessageConfig::FONT_SIZE
|
||||
bitmap.text_offset_y = MessageConfig::FONT_Y_OFFSET
|
||||
end
|
||||
|
||||
# Sets a bitmap's font to the system small font.
|
||||
def pbSetSmallFont(bitmap)
|
||||
bitmap.font.name = MessageConfig.pbGetSmallFontName
|
||||
bitmap.font.size = MessageConfig::SMALL_FONT_SIZE
|
||||
bitmap.text_offset_y = MessageConfig::SMALL_FONT_Y_OFFSET
|
||||
end
|
||||
|
||||
# Sets a bitmap's font to the system narrow font.
|
||||
def pbSetNarrowFont(bitmap)
|
||||
bitmap.font.name = MessageConfig.pbGetNarrowFontName
|
||||
bitmap.font.size = MessageConfig::NARROW_FONT_SIZE
|
||||
bitmap.text_offset_y = MessageConfig::NARROW_FONT_Y_OFFSET
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
# Represents a window with no formatting capabilities. Its text color can be set,
|
||||
# Represents a window with no formatting capabilities. Its text color can be set,
|
||||
# though, and line breaks are supported, but the text is generally unformatted.
|
||||
class Window_UnformattedTextPokemon < SpriteWindow_Base
|
||||
attr_reader :text
|
||||
@@ -101,7 +101,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
|
||||
self.contents = pbDoEnsureBitmap(self.contents, self.width - self.borderX,
|
||||
self.height - self.borderY)
|
||||
self.contents.clear
|
||||
drawTextEx(self.contents, 0, 4, self.contents.width, 0,
|
||||
drawTextEx(self.contents, 0, -2, self.contents.width, 0, # TEXT OFFSET
|
||||
@text.gsub(/\r/, ""), @baseColor, @shadowColor)
|
||||
end
|
||||
end
|
||||
@@ -317,7 +317,6 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
|
||||
chy = ch[2] + ch[4]
|
||||
width = chx if width < chx
|
||||
height = chy if height < chy
|
||||
ch[2] += 4
|
||||
if !ch[5] && ch[0] == "\n"
|
||||
numlines += 1
|
||||
if numlines >= visiblelines
|
||||
@@ -345,7 +344,6 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
|
||||
chy = ch[2] + ch[4]
|
||||
width = chx if width < chx
|
||||
height = chy if height < chy
|
||||
ch[2] += 4
|
||||
@textchars.push(ch[5] ? "" : ch[0])
|
||||
end
|
||||
end
|
||||
@@ -715,7 +713,10 @@ class Window_InputNumberPokemon < SpriteWindow_Base
|
||||
|
||||
def textHelper(x, y, text, i)
|
||||
textwidth = self.contents.text_size(text).width
|
||||
pbDrawShadowText(self.contents, x + (12 - (textwidth / 2)), y, textwidth + 4, 32, text, @baseColor, @shadowColor)
|
||||
pbDrawShadowText(self.contents,
|
||||
x + (12 - (textwidth / 2)),
|
||||
y - 2 + (self.contents.text_offset_y || 0), # TEXT OFFSET (the - 2)
|
||||
textwidth + 4, 32, text, @baseColor, @shadowColor)
|
||||
if @index == i && @active && @frame / 15 == 0
|
||||
self.contents.fill_rect(x + (12 - (textwidth / 2)), y + 30, textwidth, 2, @baseColor)
|
||||
end
|
||||
@@ -735,7 +736,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
||||
super(x, y, width, height)
|
||||
@item_max = 1
|
||||
@column_max = 1
|
||||
@virtualOy = 0
|
||||
@virtualOy = 2 # TEXT OFFSET
|
||||
@index = -1
|
||||
@row_height = 32
|
||||
@column_spacing = 32
|
||||
@@ -803,7 +804,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base
|
||||
def top_row=(row)
|
||||
row = row_max - 1 if row > row_max - 1
|
||||
row = 0 if row < 0
|
||||
@virtualOy = row * @row_height
|
||||
@virtualOy = (row * @row_height) + 2 # TEXT OFFSET (the + 2)
|
||||
end
|
||||
|
||||
def top_item
|
||||
@@ -1106,7 +1107,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
|
||||
|
||||
def drawCursor(index, rect)
|
||||
if self.index == index
|
||||
pbCopyBitmap(self.contents, @selarrow.bitmap, rect.x, rect.y)
|
||||
pbCopyBitmap(self.contents, @selarrow.bitmap, rect.x, rect.y + 2) # TEXT OFFSET (counters the offset above)
|
||||
end
|
||||
return Rect.new(rect.x + 16, rect.y, rect.width - 16, rect.height)
|
||||
end
|
||||
@@ -1223,8 +1224,8 @@ class Window_CommandPokemon < Window_DrawableCommand
|
||||
def drawItem(index, _count, rect)
|
||||
pbSetSystemFont(self.contents) if @starting
|
||||
rect = drawCursor(index, rect)
|
||||
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height,
|
||||
@commands[index], self.baseColor, self.shadowColor)
|
||||
pbDrawShadowText(self.contents, rect.x, rect.y + (self.contents.text_offset_y || 0),
|
||||
rect.width, rect.height, @commands[index], self.baseColor, self.shadowColor)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -663,7 +663,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
|
||||
elsif isspace
|
||||
hadspace = true
|
||||
end
|
||||
texty = (lineheight * y) + yDst + yStart
|
||||
texty = (lineheight * y) + yDst + yStart - 2 # TEXT OFFSET
|
||||
colors = getLastColors(colorstack, opacitystack, defaultcolors)
|
||||
# Push character
|
||||
if heightDst < 0 || texty < yDst + heightDst
|
||||
@@ -1083,8 +1083,8 @@ def drawTextEx(bitmap, x, y, width, numlines, text, baseColor, shadowColor)
|
||||
end
|
||||
|
||||
def drawFormattedTextEx(bitmap, x, y, width, text, baseColor = nil, shadowColor = nil, lineheight = 32)
|
||||
base = baseColor ? baseColor.clone : Color.new(12 * 8, 12 * 8, 12 * 8)
|
||||
shadow = shadowColor ? shadowColor.clone : Color.new(26 * 8, 26 * 8, 25 * 8)
|
||||
base = baseColor ? baseColor.clone : Color.new(96, 96, 96)
|
||||
shadow = shadowColor ? shadowColor.clone : Color.new(208, 208, 200)
|
||||
text = "<c2=" + colorToRgb16(base) + colorToRgb16(shadow) + ">" + text
|
||||
chars = getFormattedText(bitmap, x, y, width, -1, text, lineheight)
|
||||
drawFormattedChars(bitmap, chars)
|
||||
@@ -1100,7 +1100,6 @@ def pbDrawShadowText(bitmap, x, y, width, height, string, baseColor, shadowColor
|
||||
return if !bitmap || !string
|
||||
width = (width < 0) ? bitmap.text_size(string).width + 1 : width
|
||||
height = (height < 0) ? bitmap.text_size(string).height + 1 : height
|
||||
y += 4
|
||||
if shadowColor && shadowColor.alpha > 0
|
||||
bitmap.font.color = shadowColor
|
||||
bitmap.draw_text(x + 2, y, width, height, string, align)
|
||||
@@ -1148,7 +1147,7 @@ def pbDrawTextPositions(bitmap, textpos)
|
||||
textpos.each do |i|
|
||||
textsize = bitmap.text_size(i[0])
|
||||
x = i[1]
|
||||
y = i[2] + 6
|
||||
y = i[2]
|
||||
case i[3]
|
||||
when true, 1 # right align
|
||||
x -= textsize.width
|
||||
|
||||
Reference in New Issue
Block a user