Socket
Socket
Sign inDemoInstall

acnhmsgbox

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    acnhmsgbox

Create message box like Animal Crossing (New Horizon) message box.


Version published
Maintainers
1
Created

Readme

Source

Animal Crossing Message Box

acnhMsgBox is a library who create you a message box like in Animal Crossing New Horizon

imageBefore

imageAfter

Getting Started

⚠️ | This library should be used in a browser, it's doesn't work in Node.js environment

Installing

Install with npm

npm install acnhmsgbox

or with the -s parameters if you want install it and adds the entry to the package.json file dependencies

npm install acnhmsgbox -s

Example

Open the index.html in the example folder and enjoy :)

How to use

Like that

<script type="text/javascript" src="./acnhMessageBox.js"></script>
<script type="text/javascript">
var msgBox = new ACMsgBox({
	title: "Mélo",
	idDiv: "svgDiv",
	textWriteInProcess: true, 
	lines:{
		1: ["Et voilà ! Je peux te racheter le tout"], 
		2: ["pour {1 988 000 clochettes.} Qu'est-ce"], 
		3: ["que tu en dis ?"]
	}
})

function draw() {
	msgBox.draw()
}
</script>

Documentation

Constructor options

PARAMETERTYPEOPTIONALDEFAULTDESCRIPTION
titleStringMéloTitle of the message box (7 characters max)
idDivStringnoneIf it's not set, the SVG will displayed at the end of your body element
textWriteInProcessBooleanfalseIf it's set to false, the text will not be write by the library
linesObjectnullObject who contain text to display, 3 lines max. (After much tests, I advise 37 characters length per lines)
new ACMsgBox({
	title: "Server", // If title is not set, default title is "Mélo"
	idDiv: "svgDiv", // The id of the div where you want to display the SVG
	textWriteInProcess: true, 
	lines:{
		1: ["Et voilà ! Je peux te racheter le tout"], 
		2: ["pour {1 988 000 clochettes.} Qu'est-ce"], 
		3: ["que tu en dis ?"]
	}
})

Methods

draw()

Draw the message box. (⚠️ | Without calling this method, your message box doesn't display)

ACMsgBox.draw()

Authors

  • Théo Pierné - Initial work - TheoPierne

License

This project is licensed under the ISC License - see the LICENSE file for details

Keywords

FAQs

Last updated on 29 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc