gfx

package
v0.0.0-...-fe76f8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 35 Imported by: 1

Documentation

Overview

Code generated for package gfx by go-bindata DO NOT EDIT. (@generated) sources: JetBrainsMono-2.242/.DS_Store JetBrainsMono-2.242/AUTHORS.txt JetBrainsMono-2.242/OFL.txt JetBrainsMono-2.242/fonts/.DS_Store JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Bold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-BoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ExtraBold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ExtraBoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ExtraLight.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ExtraLightItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Italic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Light.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-LightItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Medium.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-MediumItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Regular.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-SemiBold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-SemiBoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-Thin.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMono-ThinItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Bold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-BoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ExtraBold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ExtraBoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ExtraLight.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ExtraLightItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Italic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Light.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-LightItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Medium.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-MediumItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Regular.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-SemiBold.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-SemiBoldItalic.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-Thin.ttf JetBrainsMono-2.242/fonts/ttf/JetBrainsMonoNL-ThinItalic.ttf JetBrainsMono-2.242/fonts/variable/JetBrainsMono-Italic[wght].ttf JetBrainsMono-2.242/fonts/variable/JetBrainsMono[wght].ttf JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Bold.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-BoldItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ExtraBold.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ExtraBoldItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ExtraLight.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ExtraLightItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Italic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Light.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-LightItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Medium.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-MediumItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Regular.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-SemiBold.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-SemiBoldItalic.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-Thin.woff2 JetBrainsMono-2.242/fonts/webfonts/JetBrainsMono-ThinItalic.woff2

Index

Constants

View Source
const (
	SEARCH_SIZE     = 16
	REACH_SIZE      = 8
	DEBUG_REACHABLE = false
)
View Source
const FADE_SECS = float64(0.5)
View Source
const LAYER_MAX_FADE = 0.5
View Source
const MAX_TIME = 1000
View Source
const NEAR_SILENCE = -10
View Source
const USER_DEFINED_CALLS = "// USER_DEFINED_CALLS"
View Source
const USER_DEFINED_PROTO = "// USER_DEFINED_PROTO"
View Source
const VERSION = "0.1"

Variables

View Source
var DAYLIGHT_ONE [4]float32 = [4]float32{1, 1, 1, 1}
View Source
var ZERO_OFFSET [2]float32

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func CompileShader

func CompileShader(source string, shaderType uint32) (uint32, error)

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func NewProgram

func NewProgram(vertexShaderSource, fragmentShaderSource string) (uint32, error)

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type App

type App struct {
	Game           Game
	Fonts          []*Font
	Config         *AppConfig
	Window         *glfw.Window
	KeyState       map[glfw.Key]*KeyPress
	RecordChars    bool
	RecordCharsKey glfw.Key
	CharBuffer     strings.Builder

	View          *View
	ViewVisible   bool
	Ui            *Ui
	Dir           string
	Loader        *world.Loader
	Width, Height int

	MouseX, MouseY int32

	MousePixelX, MousePixelY int32
	MouseButtonDown          int32
	DragStartX, DragStartY   int32

	MouseButtonAction                    int
	Dragging                             bool
	DraggedPanel                         *Panel
	DraggedPanelOffsX, DraggedPanelOffsY int
	DragAction                           string
	DragIndex                            int

	Loading bool
	Cursors map[string]*glfw.Cursor

	Console *Term

	Shaders map[string]*ShaderCode

	Audio *Audio
	// contains filtered or unexported fields
}

func NewApp

func NewApp(name string, gameDir string, width, height int, targetFps float64, fullscreen, soundoff bool) *App

func (*App) AppExit

func (app *App) AppExit(w *glfw.Window)

func (*App) CalcFps

func (app *App) CalcFps()

func (*App) CharTyped

func (app *App) CharTyped(w *glfw.Window, char rune)

func (*App) CompleteDrag

func (app *App) CompleteDrag()

func (*App) FadeDone

func (app *App) FadeDone()

func (*App) FadeIn

func (app *App) FadeIn(fx func())

func (*App) FadeOut

func (app *App) FadeOut(fx func())

func (*App) GetScreenPos

func (app *App) GetScreenPos(x, y, z int) (int, int)

func (*App) HideCursorShape

func (app *App) HideCursorShape()

func (*App) IsDown

func (app *App) IsDown(key glfw.Key) bool

func (*App) IsDownAlt

func (app *App) IsDownAlt(key1, key2 glfw.Key) bool

func (*App) IsDownAlt1

func (app *App) IsDownAlt1(key1 glfw.Key) bool

func (*App) IsDownMod

func (app *App) IsDownMod(key glfw.Key, mod glfw.ModifierKey) bool

func (*App) IsFirstDown

func (app *App) IsFirstDown(key glfw.Key) bool

func (*App) IsFirstDownMod

func (app *App) IsFirstDownMod(key glfw.Key, mod glfw.ModifierKey) bool

func (*App) Keypressed

func (app *App) Keypressed(w *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey)

func (*App) LoadMap

func (app *App) LoadMap(name string) (*map[string]interface{}, error)

func (*App) MouseClick

func (app *App) MouseClick(w *glfw.Window, button glfw.MouseButton, action glfw.Action, mods glfw.ModifierKey)

func (*App) MousePos

func (app *App) MousePos(w *glfw.Window, xpos float64, ypos float64)

func (*App) MouseScroll

func (app *App) MouseScroll(w *glfw.Window, xoffs, yoffs float64)

func (*App) PanelAtMouse

func (app *App) PanelAtMouse() (*Panel, int, int)

func (*App) Print

func (app *App) Print()

func (*App) Run

func (app *App) Run()

func (*App) SaveMap

func (app *App) SaveMap(name string, m map[string]interface{}) error

func (*App) SetCursor

func (app *App) SetCursor(name string)

func (*App) SetCursorShape

func (app *App) SetCursorShape(img image.Image)

func (*App) SetCursorTmp

func (app *App) SetCursorTmp(name string)

func (*App) SetTimer

func (app *App) SetTimer(secs float64, fx string)

func (*App) Sleep

func (app *App) Sleep(lastTime float64) (float64, float64)

func (*App) StartApp

func (app *App) StartApp(game Game, gameDir string) *App

func (*App) ToggleConsole

func (app *App) ToggleConsole()

func (*App) Walk

func (app *App) Walk()

type AppConfig

type AppConfig struct {
	Original   map[string]interface{}
	GameDir    string
	Title      string
	Name       string
	Version    float64
	ViewSize   int
	ViewSizeZ  int
	SectorSize int

	Templates map[string][]*Template
	// contains filtered or unexported fields
}

type Area

type Area struct {
	// contains filtered or unexported fields
}

type Audio

type Audio struct {
	Sounds map[string]*SoundEffect
	Music  map[string]*SoundEffect
	// contains filtered or unexported fields
}

func NewAudio

func NewAudio(sounds map[string]*SoundInfo, music map[string]*SoundInfo, soundoff bool) *Audio

func (*Audio) Play

func (audio *Audio) Play(name string)

play a sound effect

func (*Audio) StartMusic

func (audio *Audio) StartMusic(name string)

func (*Audio) StopMusic

func (audio *Audio) StopMusic()

type Block

type Block struct {
	// contains filtered or unexported fields
}

Block is a displayed Shape

type BlockPos

type BlockPos struct {
	ScrollOffset [2]float32
	// contains filtered or unexported fields
}

BlockPos is a displayed Shape at a location

func (*BlockPos) Draw

func (b *BlockPos) Draw(view *View, block *Block, extraIndex int, shader *ViewShader)

type BoundingBox

type BoundingBox struct {
	X, Y, Z int
	W, H, D int
}

func (*BoundingBox) Set

func (bb *BoundingBox) Set(x, y, z, w, h, d int)

func (*BoundingBox) SetPos

func (bb *BoundingBox) SetPos(x, y, z int)

type DrawState

type DrawState struct {
	// contains filtered or unexported fields
}

type Fade

type Fade struct {
	// contains filtered or unexported fields
}

type Font

type Font struct {
	Height int
	// contains filtered or unexported fields
}

func NewFont

func NewFont(fontPath string, scale int, alphaMin, alphaDiv, space uint8) (*Font, error)

func NewFontData

func NewFontData(data []byte, scale int, alphaMin, alphaDiv, space uint8) (*Font, error)

func (*Font) ColorPrintf

func (f *Font) ColorPrintf(useColor bool, dst draw.Image, fg color.Color, x, y int, fs string, argv ...interface{})

func (*Font) Printf

func (f *Font) Printf(dst draw.Image, fg color.Color, x, y int, fs string, argv ...interface{})

func (*Font) Width

func (f *Font) Width(fs string, argv ...interface{}) float32

Width returns the width of a piece of text in pixels

type FrameBuffer

type FrameBuffer struct {
	FrameBuffer uint32
	// contains filtered or unexported fields
}

func NewFrameBuffer

func NewFrameBuffer(width, height int32, useAspectRatio, accum bool, layerFragmentShader string) *FrameBuffer

func (*FrameBuffer) Draw

func (fb *FrameBuffer) Draw(fade float32, prevFbTexture, prevFbDepth *FrameBuffer, time float32, daylight [4]float32, destFb *FrameBuffer)

func (*FrameBuffer) Enable

func (fb *FrameBuffer) Enable()

func (*FrameBuffer) EnableWH

func (fb *FrameBuffer) EnableWH(w, h int)

type Game

type Game interface {
	Init(app *App, config map[string]interface{})
	Exit()
	Name() string
	Events(delta float64, fadeDir int, mouseX, mouseY, mouseWorldX, mouseWorldY, mouseWorldZ, mouseButtonDown int32, mouseOnInteractive bool)
	GetZ() int
	DragFromUi(pixelX, pixelY int) (string, int)
	CanZoom() bool
	ViewSize() int
	RunFx(name string)
	Eval(cmd string) (interface{}, error)
	Walk(sx, sy int)
}

type KeyPress

type KeyPress struct {
	Key      glfw.Key
	Scancode int
	Action   glfw.Action
	Mods     glfw.ModifierKey
	First    bool
}

type LayerConfig

type LayerConfig struct {
	Fb                  *FrameBuffer
	Z                   float32
	VertexShader        string
	FragmentShader      string
	Texture             string
	LayerFragmentShader string
	Fade                float32
	UseAspectRatio      bool
	RenderMarked        bool
}

type Panel

type Panel struct {
	X, Y, W, H int
	Background color.Color
	Visible    bool
	Rgba       *image.RGBA

	Draggable bool
	// contains filtered or unexported fields
}

func (*Panel) Clear

func (p *Panel) Clear()

func (*Panel) ClearWithColor

func (p *Panel) ClearWithColor(bg color.Color)

func (*Panel) Draw

func (p *Panel) Draw(ui *Ui)

type PathNode

type PathNode struct {
	// contains filtered or unexported fields
}

type PathStep

type PathStep [3]int

type ShaderCode

type ShaderCode struct {
	Name         string
	ShaderSource string
	Found        bool
	Index        int
	ShaderType   uint32
}

type SoundEffect

type SoundEffect struct {
	// contains filtered or unexported fields
}

type SoundInfo

type SoundInfo struct {
	// contains filtered or unexported fields
}

type Template

type Template struct {
	Shapes map[string][][3]int
}

type Term

type Term struct {
	Width, Height int
	Font          *Font
	Panel         *Panel
	Update        bool
	Messages      []string
	Focus         bool
	// contains filtered or unexported fields
}

func NewTerm

func NewTerm(width, height int, refresh func(), ui *Ui, buffer *strings.Builder) *Term

func (*Term) Append

func (term *Term) Append(msg string)

func (*Term) Eval

func (term *Term) Eval(game Game)

func (*Term) Print

func (term *Term) Print(msg string)

func (*Term) SetFocus

func (term *Term) SetFocus(b bool) bool

func (*Term) Toggle

func (term *Term) Toggle() bool

type Texture

type Texture struct {
	// contains filtered or unexported fields
}

func LoadTexture

func LoadTexture(imageIndex int) *Texture

type TimerCall

type TimerCall struct {
	// contains filtered or unexported fields
}

type Ui

type Ui struct {
	ScreenWidth, ScreenHeight float32
	// contains filtered or unexported fields
}

func InitUi

func InitUi(screenWidth, screenHeight int) *Ui

func (*Ui) Add

func (ui *Ui) Add(x, y, w, h int, renderer func(*Panel) bool) *Panel

func (*Ui) AddBg

func (ui *Ui) AddBg(x, y, w, h int, bg color.Color, renderer func(*Panel) bool) *Panel

func (*Ui) Draw

func (ui *Ui) Draw()

func (*Ui) GetTop

func (ui *Ui) GetTop() *Panel

func (*Ui) MovePanel

func (ui *Ui) MovePanel(panel *Panel, x, y int)

func (*Ui) NewPanel

func (ui *Ui) NewPanel(x, y, w, h int, bg color.Color, renderer func(*Panel) bool) *Panel

func (*Ui) PanelAt

func (ui *Ui) PanelAt(x, y int) (*Panel, int, int)

func (*Ui) Raise

func (ui *Ui) Raise(panel *Panel)

func (*Ui) Remove

func (ui *Ui) Remove(panel *Panel)

type View

type View struct {
	Size, DrawSize int
	Loader         *world.Loader

	Cursor       *BlockPos
	ScrollOffset [3]float32

	DidClick bool

	HideSectionMarker bool
	// contains filtered or unexported fields
}

func InitView

func InitView(zoom float64, camera, shear [3]float32, loader *world.Loader, size int, shaderCodes map[string]*ShaderCode, layers []LayerConfig, undergroundModX, undergroundModY int, undergroundBlock, undergroundGround string) *View

func (*View) AddPathThroughShape

func (view *View) AddPathThroughShape(shape *shapes.Shape)

func (*View) CanFit

func (view *View) CanFit(toWorldX, toWorldY, toWorldZ int, shape *shapes.Shape, ignoreAnimated, sameBlocks, skipRestTest bool, ignoreShape *shapes.Shape) bool

func (*View) CanMoveArea

func (view *View) CanMoveArea(worldX, worldY, worldZ, xSize, ySize, zSize, dx, dy, dz int) bool

see if the area could move to its final location

func (*View) Draw

func (view *View) Draw(delta, time float64, selectMode bool)

func (*View) DrawLayer

func (view *View) DrawLayer(index int, delta float64)

func (*View) EnableLayer

func (view *View) EnableLayer(index int, enabled bool)

func (*View) EraseShape

func (view *View) EraseShape(worldX, worldY, worldZ int) (*BlockPos, int)

func (*View) EraseShapeExact

func (view *View) EraseShapeExact(worldX, worldY, worldZ int) (*BlockPos, int)

func (*View) FindPath

func (view *View) FindPath(sx, sy, sz, ex, ey, ez int, isFlying bool, dSrc, dDst, maxSteps int) []PathStep

func (*View) FindTop

func (view *View) FindTop(worldX, worldY int, shape *shapes.Shape) int

func (*View) GetBlockPos

func (view *View) GetBlockPos(worldX, worldY, worldZ int) *BlockPos

func (*View) GetBlocker

func (view *View) GetBlocker(toWorldX, toWorldY, toWorldZ int) *BlockPos

func (*View) GetClick

func (view *View) GetClick() [3]int

func (*View) GetClosestSurfacePoint

func (view *View) GetClosestSurfacePoint(mouseVector mgl32.Vec2, shape *shapes.Shape, worldX, worldY, worldZ, windowWidth, windowHeight int) (int, int, int, bool)

func (*View) GetLayerFade

func (view *View) GetLayerFade(index int) float32

func (*View) GetLocations

func (view *View) GetLocations(shapeIndex int) [][3]int

find all locations of shapeIndex

func (*View) GetMaxZ

func (view *View) GetMaxZ() int

func (*View) GetRescuePosition

func (view *View) GetRescuePosition(destX, destY, destZ int, shape *shapes.Shape, dist int) [3]int

func (*View) GetShape

func (view *View) GetShape(worldX, worldY, worldZ int) (int, int, int, int, bool)

func (*View) GetShapeExactAt

func (view *View) GetShapeExactAt(viewX, viewY, viewZ int) *shapes.Shape

debug method

func (*View) HideCursor

func (view *View) HideCursor()

func (*View) InView

func (view *View) InView(worldX, worldY, worldZ int) bool

func (*View) InVisibleView

func (view *View) InVisibleView(worldX, worldY, worldZ int) bool

func (*View) IsActivatable

func (view *View) IsActivatable(worldX, worldY, worldZ int) bool

is there a reachable location "next" to this position?

func (*View) IsAnimatedReachable

func (view *View) IsAnimatedReachable(worldX, worldY, worldZ int, shape *shapes.Shape, ignoreAnimated bool) bool

func (*View) IsEmpty

func (view *View) IsEmpty(toWorldX, toWorldY, toWorldZ int, shape *shapes.Shape) bool

func (*View) IsReachable

func (view *View) IsReachable(worldX, worldY, worldZ int, shape *shapes.Shape) bool

func (*View) Load

func (view *View) Load()

func (*View) MoveArea

func (view *View) MoveArea(worldX, worldY, worldZ, xSize, ySize, zSize, dx, dy, dz int) bool

Move an area (a 3d block) of the view. Returns true if the area moved "fits".

func (*View) MoveShape

func (view *View) MoveShape(worldX, worldY, worldZ, newWorldX, newWorldY int, isFlying bool) (int, int, int, int)

Move a shape from (worldX, worldY, worldZ) to a new position of (newWorldX, newWorldY). Returns the new Z value, or -1 if the shape won't fit.

func (*View) Scroll

func (view *View) Scroll(dx, dy, dz float32)

func (*View) SetClick

func (view *View) SetClick(worldX, worldY, worldZ int)

func (*View) SetCursor

func (view *View) SetCursor(shapeIndex int, z int)

func (*View) SetDaylight

func (view *View) SetDaylight(r, g, b, a float32)

func (*View) SetMarked

func (view *View) SetMarked(worldX, worldY, worldZ int, marked bool)

func (*View) SetMaxZ

func (view *View) SetMaxZ(z int)

func (*View) SetOffset

func (view *View) SetOffset(worldX, worldY, worldZ int, dx, dy float32)

func (*View) SetPlayerLightMode

func (view *View) SetPlayerLightMode(mode int)

func (*View) SetShape

func (view *View) SetShape(worldX, worldY, worldZ int, shapeIndex int) *BlockPos

func (*View) SetShapeAnimation

func (view *View) SetShapeAnimation(worldX, worldY, worldZ int, animationType int, dir shapes.Direction)

func (*View) SetShapeState

func (view *View) SetShapeState(worldX, worldY, worldZ int, state int32) *BlockPos

func (*View) SetUnderShape

func (view *View) SetUnderShape(shape *shapes.Shape, negativeShape *shapes.Shape)

func (*View) SetZoom

func (view *View) SetZoom(zoom float64)

func (*View) UpdateReachable

func (view *View) UpdateReachable(worldX, worldY, worldZ, radius int, testReachableShape *shapes.Shape)

func (*View) Zoom

func (view *View) Zoom(zoom float64)

type ViewContext

type ViewContext struct {
	// contains filtered or unexported fields
}

type ViewLayer

type ViewLayer struct {
	Size         [3]float32
	ScrollOffset [3]float32
	Enabled      bool
	Fade         float32
	FadeTime     float32
	RenderMarked bool
	// contains filtered or unexported fields
}

func (*ViewLayer) Draw

func (layer *ViewLayer) Draw(view *View, shader *ViewShader)

type ViewShader

type ViewShader struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL