diff --git a/example/blocks/blocks/font.go b/example/blocks/blocks/font.go index 76ba71707..f3ccbf05c 100644 --- a/example/blocks/blocks/font.go +++ b/example/blocks/blocks/font.go @@ -16,18 +16,18 @@ package blocks import ( "github.com/hajimehoshi/ebiten" - "github.com/hajimehoshi/ebiten/example/internal" + "github.com/hajimehoshi/ebiten/example/common" "image/color" ) func drawTextWithShadowCenter(rt *ebiten.Image, str string, x, y, scale int, clr color.Color, width int) error { - w := internal.ArcadeFont.TextWidth(str) * scale + w := common.ArcadeFont.TextWidth(str) * scale x += (width - w) / 2 - return internal.ArcadeFont.DrawTextWithShadow(rt, str, x, y, scale, clr) + return common.ArcadeFont.DrawTextWithShadow(rt, str, x, y, scale, clr) } func drawTextWithShadowRight(rt *ebiten.Image, str string, x, y, scale int, clr color.Color, width int) error { - w := internal.ArcadeFont.TextWidth(str) * scale + w := common.ArcadeFont.TextWidth(str) * scale x += width - w - return internal.ArcadeFont.DrawTextWithShadow(rt, str, x, y, scale, clr) + return common.ArcadeFont.DrawTextWithShadow(rt, str, x, y, scale, clr) } diff --git a/example/blocks/blocks/gamepadscene.go b/example/blocks/blocks/gamepadscene.go index 326b4ae54..1b7705834 100644 --- a/example/blocks/blocks/gamepadscene.go +++ b/example/blocks/blocks/gamepadscene.go @@ -17,7 +17,7 @@ package blocks import ( "fmt" "github.com/hajimehoshi/ebiten" - "github.com/hajimehoshi/ebiten/example/internal" + "github.com/hajimehoshi/ebiten/example/common" "image/color" "strings" ) @@ -103,7 +103,7 @@ ROTATE RIGHT: %s msg = "OK!" } str := fmt.Sprintf(f, s.buttonStates[0], s.buttonStates[1], s.buttonStates[2], s.buttonStates[3], s.buttonStates[4], msg) - if err := internal.ArcadeFont.DrawTextWithShadow(screen, str, 16, 16, 1, color.White); err != nil { + if err := common.ArcadeFont.DrawTextWithShadow(screen, str, 16, 16, 1, color.White); err != nil { return err } return nil diff --git a/example/blocks/blocks/gamescene.go b/example/blocks/blocks/gamescene.go index b644af6a0..9ba623991 100644 --- a/example/blocks/blocks/gamescene.go +++ b/example/blocks/blocks/gamescene.go @@ -17,7 +17,7 @@ package blocks import ( "github.com/hajimehoshi/ebiten" "github.com/hajimehoshi/ebiten/ebitenutil" - "github.com/hajimehoshi/ebiten/example/internal" + "github.com/hajimehoshi/ebiten/example/common" "image/color" _ "image/jpeg" "math/rand" @@ -85,7 +85,7 @@ func init() { } // Windows: Next x, y = nextWindowLabelPosition() - if err := internal.ArcadeFont.DrawTextWithShadow(imageWindows, "NEXT", x, y, 1, fontColor); err != nil { + if err := common.ArcadeFont.DrawTextWithShadow(imageWindows, "NEXT", x, y, 1, fontColor); err != nil { panic(err) } x, y = nextWindowPosition() @@ -127,7 +127,7 @@ func drawWindow(r *ebiten.Image, x, y, width, height int) error { var fontColor = color.NRGBA{0x40, 0x40, 0xff, 0xff} func drawTextBox(r *ebiten.Image, label string, x, y, width int) error { - if err := internal.ArcadeFont.DrawTextWithShadow(r, label, x, y, 1, fontColor); err != nil { + if err := common.ArcadeFont.DrawTextWithShadow(r, label, x, y, 1, fontColor); err != nil { return err } y += blockWidth diff --git a/example/blocks/blocks/titlescene.go b/example/blocks/blocks/titlescene.go index 6f0737e31..af901da97 100644 --- a/example/blocks/blocks/titlescene.go +++ b/example/blocks/blocks/titlescene.go @@ -17,7 +17,7 @@ package blocks import ( "github.com/hajimehoshi/ebiten" "github.com/hajimehoshi/ebiten/ebitenutil" - "github.com/hajimehoshi/ebiten/example/internal" + "github.com/hajimehoshi/ebiten/example/common" "image/color" ) @@ -112,9 +112,9 @@ func (s *TitleScene) Draw(r *ebiten.Image) error { } message := "PRESS SPACE TO START" - x := (ScreenWidth - internal.ArcadeFont.TextWidth(message)) / 2 + x := (ScreenWidth - common.ArcadeFont.TextWidth(message)) / 2 y := ScreenHeight - 48 - if err := internal.ArcadeFont.DrawTextWithShadow(r, message, x, y, 1, color.NRGBA{0x80, 0, 0, 0xff}); err != nil { + if err := common.ArcadeFont.DrawTextWithShadow(r, message, x, y, 1, color.NRGBA{0x80, 0, 0, 0xff}); err != nil { return err } return nil @@ -129,8 +129,8 @@ func (s *TitleScene) drawTitleBackground(r *ebiten.Image, c int) error { func drawLogo(r *ebiten.Image, str string) error { scale := 4 - textWidth := internal.ArcadeFont.TextWidth(str) * scale + textWidth := common.ArcadeFont.TextWidth(str) * scale x := (ScreenWidth - textWidth) / 2 y := 32 - return internal.ArcadeFont.DrawTextWithShadow(r, str, x, y, scale, color.NRGBA{0x00, 0x00, 0x80, 0xff}) + return common.ArcadeFont.DrawTextWithShadow(r, str, x, y, scale, color.NRGBA{0x00, 0x00, 0x80, 0xff}) } diff --git a/example/internal/font.go b/example/common/font.go similarity index 99% rename from example/internal/font.go rename to example/common/font.go index 61e7f48e4..ba042e9e0 100644 --- a/example/internal/font.go +++ b/example/common/font.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package common import ( "github.com/hajimehoshi/ebiten" diff --git a/example/keyboard/keyboard/gen.go b/example/keyboard/keyboard/gen.go index 4b2b61ae4..830a66a66 100644 --- a/example/keyboard/keyboard/gen.go +++ b/example/keyboard/keyboard/gen.go @@ -18,8 +18,8 @@ package main import ( "github.com/hajimehoshi/ebiten" - "github.com/hajimehoshi/ebiten/example/internal" - einternal "github.com/hajimehoshi/ebiten/internal" + "github.com/hajimehoshi/ebiten/example/common" + "github.com/hajimehoshi/ebiten/internal" "image" "image/color" "image/draw" @@ -54,7 +54,7 @@ func drawKey(t *ebiten.Image, name string, x, y, width int) { t.DrawLine(x, y+height-4, x+3, y+height-1, c) t.DrawLine(x+width-1, y+height-4, x+width-4, y+height-1, c) - internal.ArcadeFont.DrawText(t, name, x+4, y+5, 1, color.White) + common.ArcadeFont.DrawText(t, name, x+4, y+5, 1, color.White) } func outputKeyboardImage() (map[string]image.Rectangle, error) { @@ -143,7 +143,7 @@ func KeyRect(name string) (image.Rectangle, bool) { }` func outputKeyRectsGo(k map[string]image.Rectangle) error { - license, err := einternal.LicenseComment() + license, err := internal.LicenseComment() if err != nil { return err }