{"id":33169541,"url":"https://github.com/netgfx/phaser_modals","last_synced_at":"2026-01-28T14:15:12.849Z","repository":{"id":27670860,"uuid":"31156863","full_name":"netgfx/phaser_modals","owner":"netgfx","description":"Phaser.io Modals creator script","archived":false,"fork":false,"pushed_at":"2018-09-05T18:19:25.000Z","size":59,"stargazers_count":60,"open_issues_count":4,"forks_count":18,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-08-17T04:33:36.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netgfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-22T08:14:05.000Z","updated_at":"2025-05-04T20:23:55.000Z","dependencies_parsed_at":"2022-07-28T20:10:02.938Z","dependency_job_id":null,"html_url":"https://github.com/netgfx/phaser_modals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/netgfx/phaser_modals","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netgfx%2Fphaser_modals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netgfx%2Fphaser_modals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netgfx%2Fphaser_modals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netgfx%2Fphaser_modals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netgfx","download_url":"https://codeload.github.com/netgfx/phaser_modals/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netgfx%2Fphaser_modals/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285494607,"owners_count":27181443,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T01:00:33.530Z","updated_at":"2025-11-20T19:01:00.357Z","avatar_url":"https://github.com/netgfx.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"# Phaser_Modals\nPhaser.io Modals creator script\n\n## Live Example: https://codepen.io/7linternational/pen/eeMNMm/\n\n### Tutorial blog post: http://nightlycoding.com/wordpress/phaser-io-modal-creator/\n\n### API\n\u003cstrong\u003eGeneral Options:\u003c/strong\u003e\n\n\u003cul\u003e\n\t\u003cli\u003e\u003cstrong\u003etype:\u003c/strong\u003e This is the name of the modal, which we use to identify it\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003eincludeBackground:\u003c/strong\u003e This toggles the modal background on or off (default off)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ebackgroundColor:\u003c/strong\u003e This is the modal background color (default 0x000000)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ebackgroundOpacity: \u003c/strong\u003e This sets the modal background opacity (default: 0.7)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003emodalCloseOnInput:\u003c/strong\u003e If we want the modal to close when we click on the background (default off)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cstrong\u003eModal elements properties\u003c/strong\u003e\n\n\u003cul\u003e\n\t\u003cli\u003e\u003cstrong\u003etype\u003c/strong\u003e | The type of the element (text, bitmapText, image, button, graphics)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ecolor\u003c/strong\u003e | The color of the element (text only)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003efontFamily\u003c/strong\u003e | The font family to use (bitmapText or text)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003efontSize\u003c/strong\u003e | The font size of the text or bitmaptext (bitmapText or text)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ealign\u003c/strong\u003e | The alignment of the text (center, left, right and text only)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003eoffsetX\u003c/strong\u003e | The offset on x-axis of the element from the center of the game (0 is dead center)\u003c/li\u003e\t\u003cli\u003e\u003cstrong\u003eoffsetY\u003c/strong\u003e | The offset on y-axis of the element from the center of the game (0 is dead center)\u003c/li\u003e\t\u003cli\u003e\u003cstrong\u003econtentScale\u003c/strong\u003e | The scaling to apply to the element (1 is no scale, default = 1)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003estroke\u003c/strong\u003e | The stroke color to apply to the text (default = 0x000000)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003estrokeThickness\u003c/strong\u003e | The stroke thickness to apply to the text (default = 0)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003econtent\u003c/strong\u003e | The actual content of the element can be string, number, cache key (for images), url of image\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ecallback\u003c/strong\u003e | The callback function to call when the element is clicked/touched (basically when input down event is fired)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003efixedToCamera\u003c/strong\u003e | Whether or not the modal is fixed to camera (default = false)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003eatlasParent\u003c/strong\u003e | When adding a sprite or button from an atlasHash/Array (default = \"\")\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ebuttonHover\u003c/strong\u003e | Key for the button state  hover (default = content)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ebuttonActive\u003c/strong\u003e | Key for the button state active (default = content)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003egraphicColor\u003c/strong\u003e | Graphic color (default = 0xffffff)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003egraphicOpacity\u003c/strong\u003e | Graphic opacity (default = 1)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003egraphicWidth\u003c/strong\u003e | Graphic width (default = 200)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003egraphicHeight\u003c/strong\u003e | Graphic height (default = 200)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003egraphicRadius\u003c/strong\u003e | Graphic border radius (default = 0)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003elockPosition\u003c/strong\u003e | locks the position after an update (default = false)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003etileSpriteWidth\u003c/strong\u003e | The width of the TileSprite. (default = game.width)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003etileSpriteHeight\u003c/strong\u003e | The height of the TileSprite (default = game.height)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003eanchor\u003c/strong\u003e | Anchor for element (default = {x:0,y:0})\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003eangle\u003c/strong\u003e | The angle property is the rotation of the element (default = 0)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ex\u003c/strong\u003e | The position of the element on the x axis (default = 0)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ey\u003c/strong\u003e | The position of the element on the y axis (default = 0)\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003eframe\u003c/strong\u003e | If this Sprite is using part of a sprite sheet or texture atlas you\n\t    can specify the exact frame to use by giving a string or numeric index. \u003c/li\u003e\n\u003c/ul\u003e\n\nTo make part of text **BOLD** include it like this:\n\n```\n\tcontent: \"The white {behind} me\\n{is} a {[Phaser.Graphic]}\"\n```\n(Add text that you want bold into **{}** )\n\n\u003cstrong\u003eAvailable functions\u003c/strong\u003e\n\n\u003cul\u003e\n\t\u003cli\u003e\u003cstrong\u003ecreateModal\u003c/strong\u003e | The function to create a modal, takes an object with the modal properties as an argument\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003eshowModal\u003c/strong\u003e | The function to show a previously created modal, takes the modal name/type as an argument\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003ehideModal\u003c/strong\u003e | The function to hide a previously created and shown modal, takes the modal name/type as an argument\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003egetModalItem\u003c/strong\u003e | The function to get an element from a previously created modal, takes the modal name/type and the position of the element (index) as an argument\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003edestroyModal\u003c/strong\u003e | Remove a previously created modal from the registry\u003c/li\u003e\n\t\u003cli\u003e\u003cstrong\u003eupdateModalValue\u003c/strong\u003e | Dynamically change the value of an element inside a modal,takes respectively: the new value, the modal name/type, and the index of the element as arguments (experimental function)\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003chr\u003e\n\nNote: Currently there is a bug on Phaser \u003c 2.4.4 with WebGL using the last texture used if an empty sprite is created, in order to fix this you can add: ``` innerModal.texture.baseTexture.skipRender = false; ```\n\u003cbr\u003eIssue: https://github.com/photonstorm/phaser/issues/2176\nThanks for this info @cemadil\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetgfx%2Fphaser_modals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetgfx%2Fphaser_modals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetgfx%2Fphaser_modals/lists"}