forked from yoannmoinet/nipplejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(collection): add initial frontPosition option
Add the option to be able to indicate the initial position of the joystick front Currently the position is set to x: 0 and: 0 and does not allow modification via options when creating the nipple close yoannmoinet#133
- Loading branch information
Showing
2 changed files
with
61 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>NippleJS</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=0.5"> | ||
<style> | ||
html, body { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
|
||
#left { | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
height: 100%; | ||
width: 100%; | ||
background: rgba(1,77,129, 0.1); | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="left"></div> | ||
<script src="/dist/nipplejs.js"></script> | ||
<script> | ||
var joystickL = nipplejs.create({ | ||
zone: document.getElementById('left'), | ||
mode: 'static', | ||
position: { left: '50%', top: '50%' }, | ||
color: '#014d81', | ||
size: 200, | ||
restJoystick: false, | ||
frontPosition: {x: 25, y: -35}, | ||
restJoystick: false | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters