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

Method draw

code/main/SuperRPGMenu.ts:27–38  ·  view source on GitHub ↗
(renderArea: RenderArea)

Source from the content-addressed store, hash-verified

25 }
26
27 public draw(renderArea: RenderArea): void{
28 // Draw the separating line
29 renderArea.drawVerticalLine("|", 26, 3, 11);
30
31 // Draw the ascii art on the left
32 renderArea.drawArray(Database.getAscii(this.asciiName), 0 + Math.floor((26-Database.getAsciiWidth(this.asciiName))/2), 2 + Math.floor((10-Database.getAsciiHeight(this.asciiName))/2));
33
34 // Draw the entries
35 for(var i = 0; i < this.entries.length; i++){
36 this.entries[i].draw(renderArea, 27, 3+Math.floor((10-(this.entries.length*2))/2)+i*2, (this.currentlySelectedEntryIndex == i), 26);
37 }
38 }
39
40 public pressedDownButton(): void{
41 this.currentlySelectedEntryIndex += 1;

Callers

nothing calls this directly

Calls 3

drawVerticalLineMethod · 0.80
drawArrayMethod · 0.80
getAsciiMethod · 0.80

Tested by

no test coverage detected