Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type SVG struct { <SVG INFO> }
- type Dimension struct { Width float64, Height float64}
- type Coordinate struct { X float64, Y float64}
- type Emoji struct { Name string, ID string, Size Dimension, Center Coordinate, Graphic SVG }
- type Logo struct { Size Dimension, AnchorPoints []Coordinate, NumOfPoints int, Graphic DVG }
- type EmojiBase struct { size Dimension, center Coordinate}
- type LogoBase struct { size Dimension }
- type Nanoji_Logo struct { Emojis []Emoji, BaseLogo Logo }
- emoji_base_spec := EmojiBase{ Size : Dimension{Width: 32.00, Height: 32.00}, Center : Coordinate{X: 16, Y: 16} }
- logo_base_size := Dimension{Width: 224.5, Height: 961}
- //Scaling Emoji to fit the base dimension of the Nanoji Logo
- func (e *Emoji) EmojiBaseDimension(b EmojiBase){
- select e.name{
- case : "tongue_out"
- e.Size *= b.Size
- e.Center = CenterOffset(b.Center, <x>, <y>)
- case : "devil"
- e.Size *= b.Size
- e.Center = CenterOffset(b.Center, <x>, <y>)
- case : "angel"
- e.Size *= b.Size
- e.Center = CenterOffset(b.Center, <x>, <y>)
- /* -----------------------------------------------------
- Insert other edge cases
- ----------------------------------------------------- */
- default:
- e.Size = emoji_base_dimension
- e.Center = emoji_base_center
- }
- }
- //Modify Center of Edge Case Emojis
- func CenterOffset(originalCenter Coordinate, x_offset float64, y_offset float64) (offset_center Coordinate){
- offset_ceter = Coordinate{ X: originalCenter.X + x_offset, Y: originalCenter.Y + y_offset}
- return offset_center
- }
- //Resize Logo to new specs
- func (l *Logo) NewDimensions(newLogoWidth float64){
- percentChange = newLogoWidth / l.Size.Width
- l.Size.Width *= (l.Size.Width * percentChange)
- l.Size.Height *= (l.Size.Height * percentChange)
- //Scaling All Anchor points
- for i := 0; i < l.NumOfPoints; i++{
- l.AnchorPoints[i].X *= (l.AnchorPoints[i].X * percentChange)
- 1.AnchorPoints[i].Y *= (1.AnchorPoints[i].Y * percentChange)
- }
- }
- //Resize emote to fit perfectly with new logo size
- func (e *Emoji) NewDimensions(newLogoWidth int, oldLogo LogoBase, b EmojiBase){
- e.EmojiBaseDimension(b EmojiBase)
- percentChange = newLogoWidth / oldLogo.Width
- e.Size.Width *= (e.Size.Width * percentChange)
- e.Size.Height *= (e.Size.Height * percentChange)
- e.Center.X *= (e.Center.X * percentChange)
- e.Center.Y *= (e.Center.Y * percentChange)
- }
- //Create New Nanoji SVG from BaseLogo and Emoji(s)
- func CreateNanoji (e Emoji, l Logo) (n Nanoji){
- //TO BE WRITTEN
- }
Add Comment
Please, Sign In to add comment