holysheepcoder Posted February 12, 2019 Share Posted February 12, 2019 let width = this.game.config.width; let height = this.game.config.height; let startGameText = this.make.text(findGameButtonText).setOrigin(0.5, 0.5); let startGameButton = this.add.sprite(0, 0, 'ui-spritesheet-blue', 'blue_button00.png'); let startGameContainer = this.add.container(0, 0, [ startGameButton, startGameText ]); startGameContainer.setSize(190, 50).setInteractive(); let optionsText = this.make.text(menuOptionsButtonText).setOrigin(0.5, 0.5); let optionsButton = this.add.sprite(0, 0, 'ui-spritesheet-blue', 'blue_button00.png'); let optionsContainer = this.add.container(0 + 200, 0, [ optionsText, optionsButton ]); optionsContainer.setSize(190, 50).setInteractive(); let mainMenuButtons = this.add.container(width / 2, height / 2 + 200, [ startGameContainer, optionsContainer ]); mainMenuButtons.setSize(width, 50); Options for texts export const menuOptionsButtonText = { x: 0, y: 0, text: 'Options', style: { fontSize: '16px', fontFamily: 'Monospace', color: '#ffffff', align: 'center', shadow: { color: '#000000', fill: true, offsetX: 2, offsetY: 2, blur: 8 } } }; export const findGameButtonText = { x: 0, y: 0, text: 'Start game', style: { fontSize: '16px', fontFamily: 'Monospace', color: '#ffffff', align: 'center', shadow: { color: '#000000', fill: true, offsetX: 2, offsetY: 2, blur: 8 } } } I can not understand why the text "Options" is not displayed Link to comment Share on other sites More sharing options...
Antriel Posted February 12, 2019 Share Posted February 12, 2019 Think about the order of the items in the container. EDIT: And I just see it was pointless to waste time here, as you already had it solved on the Phaser forum... Link to comment Share on other sites More sharing options...
Recommended Posts