//
//  ModalComponent.swift
//  GoldWars
//
//  Created by Niko Jochim on 01.05.20.
//  Copyright © 2020 SP2. All rights reserved.
//

import GameplayKit
import SpriteKit

class ModalContentComponent: GKComponent{

	var header:	SKLabelNode
	var body:	SKLabelNode
	var footer:	SKLabelNode

	init(header: String, body: String, footer: String , anchorPoint: CGPoint) {
		self.header = 	SKLabelNode(text: header)
		self.header.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y + 125)
		self.header.fontName = "HelveticaNeue-Bold"
		self.header.fontSize = 40

		self.body 	= 	SKLabelNode(text: body)
		self.body.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y - 20)
		self.body.numberOfLines = 2
		self.body.preferredMaxLayoutWidth = 390
		self.body.horizontalAlignmentMode = SKLabelHorizontalAlignmentMode.center
		self.body.fontName = "HelveticaNeue-Bold"
		self.body.fontSize = 40

		self.footer = 	SKLabelNode(text: footer)
		self.footer.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y - 40)
		self.footer.fontName = "HelveticaNeue-Bold"
		self.footer.fontSize = 40
		super.init()
	}

	required init?(coder aDecoder: NSCoder) {
	   fatalError("init(coder:) has not been implemented")
	 }
}
