MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / addBackToButton

Method addBackToButton

code/main/Place.ts:10–18  ·  view source on GitHub ↗
(renderArea: RenderArea, callbackCollection: CallbackCollection, text: string, translated: string, otherClass: string, y: number = 0, x: number = -1)

Source from the content-addressed store, hash-verified

8
9 // Public methods
10 public addBackToButton(renderArea: RenderArea, callbackCollection: CallbackCollection, text: string, translated: string, otherClass: string, y: number = 0, x: number = -1): void{
11 // If the x position is under zero, we set it so that the button will be centered
12 if(x < 0){
13 x = renderArea.getWidth()/2 - text.length/2;
14 }
15
16 renderArea.addAsciiRealButton(text, x, y, otherClass, translated, true);
17 renderArea.addLinkCall("." + otherClass, callbackCollection);
18 }
19
20 public addBackToMainMapButton(renderArea: RenderArea, otherClass: string, textName: string = "buttonBackToTheMap"): void{
21 this.addBackToButton(renderArea,

Callers 4

addExitQuestButtonMethod · 0.80

Calls 3

addAsciiRealButtonMethod · 0.80
addLinkCallMethod · 0.80
getWidthMethod · 0.45

Tested by

no test coverage detected