mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Replaced the Nobile font with Cantarell, added a BOLD_SANS_FONT constant
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
class IMICFPS
|
class IMICFPS
|
||||||
GAME_ROOT_PATH = File.expand_path("..", File.dirname(__FILE__))
|
GAME_ROOT_PATH = File.expand_path("..", File.dirname(__FILE__))
|
||||||
|
|
||||||
SANS_SERIF_FONT = "#{GAME_ROOT_PATH}/static/fonts/Oxygen_Mono/OxygenMono-Regular.ttf"
|
SANS_FONT = "#{GAME_ROOT_PATH}/static/fonts/Cantarell/Cantarell-Regular.otf"
|
||||||
|
BOLD_SANS_FONT = "#{GAME_ROOT_PATH}/static/fonts/Cantarell/Cantarell-Bold.otf"
|
||||||
MONOSPACE_FONT = "#{GAME_ROOT_PATH}/static/fonts/Oxygen_Mono/OxygenMono-Regular.ttf"
|
MONOSPACE_FONT = "#{GAME_ROOT_PATH}/static/fonts/Oxygen_Mono/OxygenMono-Regular.ttf"
|
||||||
|
|
||||||
# Objects exported from blender using the default or meter object scale will be close to 1 GL unit
|
# Objects exported from blender using the default or meter object scale will be close to 1 GL unit
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class IMICFPS
|
|||||||
shadow_alpha: 0,
|
shadow_alpha: 0,
|
||||||
shadow_color: Gosu::Color::WHITE,
|
shadow_color: Gosu::Color::WHITE,
|
||||||
mode: :add,
|
mode: :add,
|
||||||
font: SANS_SERIF_FONT
|
font: SANS_FONT
|
||||||
)
|
)
|
||||||
|
|
||||||
@last_message_time = 0
|
@last_message_time = 0
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class IMICFPS
|
|||||||
"MATE\nTinyTanker\nOther Player Dude\nHuman 0xdeadbeef",
|
"MATE\nTinyTanker\nOther Player Dude\nHuman 0xdeadbeef",
|
||||||
size: 18,
|
size: 18,
|
||||||
mode: :add,
|
mode: :add,
|
||||||
font: SANS_SERIF_FONT,
|
font: SANS_FONT,
|
||||||
color: @color,
|
color: @color,
|
||||||
shadow: true,
|
shadow: true,
|
||||||
shadow_color: 0x88000000,
|
shadow_color: 0x88000000,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
class IMICFPS
|
class IMICFPS
|
||||||
module EntityManager # Get included into GameState context
|
module EntityManager # Get included into GameState context
|
||||||
def add_entity(entity)
|
def add_entity(entity)
|
||||||
@collision_manager.add(entity) if @collision_manager && entity.manifest.collision# Add every entity to collision manager
|
@collision_manager.add(entity) if @collision_manager && entity.manifest.collision # Add every entity to collision manager
|
||||||
Publisher.instance.publish(:create, nil, entity)
|
Publisher.instance.publish(:create, nil, entity)
|
||||||
@entities << entity
|
@entities << entity
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
title IMICFPS::NAME
|
title IMICFPS::NAME
|
||||||
@subheading = Text.new("Loading Map: #{@map_parser.metadata.name}", y: 100, size: 50, alignment: :center, font: SANS_SERIF_FONT)
|
@subheading = Text.new("Loading Map: #{@map_parser.metadata.name}", y: 100, size: 50, alignment: :center, font: SANS_FONT)
|
||||||
@description = Text.new("Map created by: #{@map_parser.metadata.authors.join(", ")}\n#{@map_parser.metadata.description}", y: 180, size: 24, alignment: :center, font: SANS_SERIF_FONT)
|
@description = Text.new("Map created by: #{@map_parser.metadata.authors.join(", ")}\n#{@map_parser.metadata.description}", y: 180, size: 24, alignment: :center, font: SANS_FONT)
|
||||||
@state = Text.new("Preparing...", y: window.height/2-40, size: 40, alignment: :center, font: SANS_SERIF_FONT)
|
@state = Text.new("Preparing...", y: window.height/2-40, size: 40, alignment: :center, font: SANS_FONT)
|
||||||
@percentage = Text.new("0%", y: window.height - 100 + 25, size: 50, alignment: :center, font: MONOSPACE_FONT)
|
@percentage = Text.new("0%", y: window.height - 100 + 25, size: 50, alignment: :center, font: SANS_FONT)
|
||||||
|
|
||||||
@dummy_entity = nil
|
@dummy_entity = nil
|
||||||
@assets = []
|
@assets = []
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
class IMICFPS
|
class IMICFPS
|
||||||
class MapEditorTool
|
class MapEditorTool
|
||||||
class Editor < CyberarmEngine::GuiState
|
class Editor < CyberarmEngine::GuiState
|
||||||
|
|
||||||
attr_reader :map
|
attr_reader :map
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
# TODO: Move everything required for a playable game map
|
# TODO: Move everything required for a playable game map
|
||||||
# in to a Scene or Scene3D container object
|
# in to a Scene or Scene3D container object
|
||||||
# and refactor Game to use it.
|
# and refactor Game to use it.
|
||||||
Publisher.new
|
Publisher.new
|
||||||
@map = Map.new( map_parser: @options[:map_parser] )
|
@map = Map.new(map_parser: @options[:map_parser])
|
||||||
@camera = PerspectiveCamera.new( position: Vector.new, aspect_ratio: window.aspect_ratio )
|
@camera = PerspectiveCamera.new( position: Vector.new, aspect_ratio: window.aspect_ratio )
|
||||||
@editor = IMICFPS::Editor.new( manifest: Manifest.new(package: "base", name: "editor") )
|
@editor = IMICFPS::Editor.new( manifest: Manifest.new(package: "base", name: "editor") )
|
||||||
@camera_controller = CameraController.new(camera: @camera, entity: @editor)
|
@camera_controller = CameraController.new(camera: @camera, entity: @editor)
|
||||||
|
|||||||
@@ -20,27 +20,54 @@ class IMICFPS
|
|||||||
@accent_color = ACCENT_COLOR
|
@accent_color = ACCENT_COLOR
|
||||||
window.needs_cursor = true
|
window.needs_cursor = true
|
||||||
|
|
||||||
@__version_text = CyberarmEngine::Text.new("<b>#{IMICFPS::NAME}</b> v#{IMICFPS::VERSION} (#{IMICFPS::RELEASE_NAME})", font: MONOSPACE_FONT)
|
@__version_text = CyberarmEngine::Text.new("<b>#{IMICFPS::NAME}</b> v#{IMICFPS::VERSION} (#{IMICFPS::RELEASE_NAME})", font: BOLD_SANS_FONT)
|
||||||
@__version_text.x = window.width - (@__version_text.width + 10)
|
@__version_text.x = window.width - (@__version_text.width + 10)
|
||||||
@__version_text.y = window.height - (@__version_text.height + 10)
|
@__version_text.y = window.height - (@__version_text.height + 10)
|
||||||
|
|
||||||
super(*args)
|
super(*args)
|
||||||
|
|
||||||
theme({ Label: { font: SANS_SERIF_FONT } })
|
theme(
|
||||||
|
{
|
||||||
|
Label:
|
||||||
|
{
|
||||||
|
font: SANS_FONT
|
||||||
|
},
|
||||||
|
Button:
|
||||||
|
{
|
||||||
|
font: BOLD_SANS_FONT,
|
||||||
|
background: [0xff222222, 0xff3A3A3E],
|
||||||
|
border_color: [0xaa_111111, 0xaa_000000],
|
||||||
|
border_thickness: 2,
|
||||||
|
text_align: :center,
|
||||||
|
# color: 0xffff8800,
|
||||||
|
color: 0xffffffff,
|
||||||
|
|
||||||
|
hover: {
|
||||||
|
background: [0xff444444, 0xff5A5A5E],
|
||||||
|
color: 0xffeeeeee
|
||||||
|
},
|
||||||
|
|
||||||
|
active: {
|
||||||
|
color: Gosu::Color::WHITE,
|
||||||
|
background: [0xff222222, 0xff1A1A1E]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def title(text, color = Gosu::Color::BLACK)
|
def title(text, color = Gosu::Color::BLACK)
|
||||||
@elements << Text.new(text, color: color, size: 100, x: 0, y: 15, font: SANS_SERIF_FONT)
|
@elements << Text.new(text, color: color, size: 100, x: 0, y: 15, font: BOLD_SANS_FONT)
|
||||||
@_title = @elements.last
|
@_title = @elements.last
|
||||||
end
|
end
|
||||||
|
|
||||||
def subtitle(text, color = Gosu::Color::WHITE)
|
def subtitle(text, color = Gosu::Color::WHITE)
|
||||||
@elements << Text.new(text, color: color, size: 50, x: 0, y: 100, font: SANS_SERIF_FONT)
|
@elements << Text.new(text, color: color, size: 50, x: 0, y: 100, font: SANS_FONT)
|
||||||
@_subtitle = @elements.last
|
@_subtitle = @elements.last
|
||||||
end
|
end
|
||||||
|
|
||||||
def link(text, color = Gosu::Color.rgb(0,127,127), &block)
|
def link(text, color = Gosu::Color.rgb(0,127,127), &block)
|
||||||
text = Text.new(text, color: color, size: 50, x: 0, y: 100 + (60 * @elements.count), font: SANS_SERIF_FONT)
|
text = Text.new(text, color: color, size: 50, x: 0, y: 100 + (60 * @elements.count), font: BOLD_SANS_FONT)
|
||||||
@elements << Link.new(text, self, block)
|
@elements << Link.new(text, self, block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -21,30 +21,6 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"lights":[
|
"lights":[
|
||||||
{
|
|
||||||
"type":"directional",
|
|
||||||
"intensity": 1,
|
|
||||||
"position": {
|
|
||||||
"x":30,
|
|
||||||
"y":10,
|
|
||||||
"z":30
|
|
||||||
},
|
|
||||||
"diffuse": {
|
|
||||||
"red":1,
|
|
||||||
"green":1,
|
|
||||||
"blue":1
|
|
||||||
},
|
|
||||||
"ambient": {
|
|
||||||
"red":0.5,
|
|
||||||
"green":0.5,
|
|
||||||
"blue":0.5
|
|
||||||
},
|
|
||||||
"specular": {
|
|
||||||
"red":0.2,
|
|
||||||
"green":0.2,
|
|
||||||
"blue":0.2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type":"point",
|
"type":"point",
|
||||||
"intensity": 1,
|
"intensity": 1,
|
||||||
@@ -68,6 +44,30 @@
|
|||||||
"green":0.2,
|
"green":0.2,
|
||||||
"blue":0.2
|
"blue":0.2
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "directional",
|
||||||
|
"intensity": 1,
|
||||||
|
"position": {
|
||||||
|
"x": 30,
|
||||||
|
"y": 10,
|
||||||
|
"z": 30
|
||||||
|
},
|
||||||
|
"diffuse": {
|
||||||
|
"red": 1,
|
||||||
|
"green": 1,
|
||||||
|
"blue": 1
|
||||||
|
},
|
||||||
|
"ambient": {
|
||||||
|
"red": 0.5,
|
||||||
|
"green": 0.5,
|
||||||
|
"blue": 0.5
|
||||||
|
},
|
||||||
|
"specular": {
|
||||||
|
"red": 0.2,
|
||||||
|
"green": 0.2,
|
||||||
|
"blue": 0.2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
BIN
static/fonts/Cantarell/Cantarell-Bold.otf
Normal file
BIN
static/fonts/Cantarell/Cantarell-Bold.otf
Normal file
Binary file not shown.
BIN
static/fonts/Cantarell/Cantarell-ExtraBold.otf
Normal file
BIN
static/fonts/Cantarell/Cantarell-ExtraBold.otf
Normal file
Binary file not shown.
BIN
static/fonts/Cantarell/Cantarell-Light.otf
Normal file
BIN
static/fonts/Cantarell/Cantarell-Light.otf
Normal file
Binary file not shown.
BIN
static/fonts/Cantarell/Cantarell-Regular.otf
Normal file
BIN
static/fonts/Cantarell/Cantarell-Regular.otf
Normal file
Binary file not shown.
BIN
static/fonts/Cantarell/Cantarell-Thin.otf
Normal file
BIN
static/fonts/Cantarell/Cantarell-Thin.otf
Normal file
Binary file not shown.
BIN
static/fonts/Cantarell/Cantarell-VF.otf
Normal file
BIN
static/fonts/Cantarell/Cantarell-VF.otf
Normal file
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2010-2012, Vernon Adams (vern@newtypography.co.uk), with Reserved Font Name Nobile.
|
Copyright (c) 2009--2019, The Cantarell Authors
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
This license is copied below, and is also available with a FAQ at:
|
This license is copied below, and is also available with a FAQ at:
|
||||||
@@ -91,3 +91,22 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Scripts contain parts of the source code of glyphsLib:
|
||||||
|
|
||||||
|
# Copyright 2015 Google Inc. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user