Skip to content

Commit

Permalink
I THINK WE'RE DONE (FOR NOW)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-eb committed Mar 2, 2021
1 parent 198c8d9 commit d7273d5
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 51 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified assets/.DS_Store
Binary file not shown.
Binary file modified assets/images/.DS_Store
Binary file not shown.
11 changes: 0 additions & 11 deletions assets/images/virtual-inputfunkin.txt

This file was deleted.

17 changes: 14 additions & 3 deletions source/DialogueBox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,15 @@ class DialogueBox extends FlxSpriteGroup
}, 5);


if (VirtualPadCamera.iOSDevice == 2 || VirtualPadCamera.iOSDevice == 4 || VirtualPadCamera.iOSDevice == 6) {
if (VirtualPadCamera.iOSDevice == 2 || VirtualPadCamera.iOSDevice == 6) {
portraitLeft = new FlxSprite(FlxG.width*0.01, FlxG.height*0.21);
portraitRight = new FlxSprite(FlxG.width*0.04, FlxG.height*0.21);
} else if (VirtualPadCamera.iOSDevice == 1) {
portraitLeft = new FlxSprite(-20, -10);
portraitRight = new FlxSprite(0, -10);
} else if (VirtualPadCamera.iOSDevice == 4) {
portraitLeft = new FlxSprite(FlxG.width*0.01, FlxG.height*0.06);
portraitRight = new FlxSprite(FlxG.width*0.04, FlxG.height*0.06);
} else {
portraitLeft = new FlxSprite(-20, 40);
portraitRight = new FlxSprite(0, 40);
Expand Down Expand Up @@ -119,7 +122,7 @@ class DialogueBox extends FlxSpriteGroup
}

box.animation.play('normalOpen');
if (VirtualPadCamera.iOSDevice == 2 || VirtualPadCamera.iOSDevice == 4 || VirtualPadCamera.iOSDevice == 6) {
if (VirtualPadCamera.iOSDevice == 2 || VirtualPadCamera.iOSDevice == 6) {
box.setPosition(FlxG.width*0.01, FlxG.height*0.1);
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 1.2));
box.updateHitbox();
Expand All @@ -135,6 +138,11 @@ class DialogueBox extends FlxSpriteGroup
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 1.2));
box.updateHitbox();
add(box);
} else if (VirtualPadCamera.iOSDevice == 4) {
box.setPosition(FlxG.width*0.01, FlxG.height*-0.05);
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 0.9));
box.updateHitbox();
add(box);
} else {
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 0.9));
box.updateHitbox();
Expand All @@ -157,7 +165,7 @@ class DialogueBox extends FlxSpriteGroup
// box.flipX = true;
}

if (VirtualPadCamera.iOSDevice == 2 || VirtualPadCamera.iOSDevice == 4 || VirtualPadCamera.iOSDevice == 6) {
if (VirtualPadCamera.iOSDevice == 2 || VirtualPadCamera.iOSDevice == 6) {
swagDialogue = new FlxTypeText(FlxG.width*0.15, FlxG.height*0.65, Std.int(FlxG.width * 0.4), "", 32);
dropText = new FlxText((FlxG.width*0.15) + 2, (FlxG.height*0.65) + 2, Std.int(FlxG.width * 0.4), "", 32);
} else if (VirtualPadCamera.iOSDevice == 1) {
Expand All @@ -166,6 +174,9 @@ class DialogueBox extends FlxSpriteGroup
} else if (VirtualPadCamera.iOSDevice == 5) {
swagDialogue = new FlxTypeText(FlxG.width*0.15, FlxG.height*0.65, Std.int(FlxG.width * 0.4), "", 32);
dropText = new FlxText((FlxG.width*0.15) + 2, (FlxG.height*0.65) + 2, Std.int(FlxG.width * 0.4), "", 32);
} else if (VirtualPadCamera.iOSDevice == 4){
swagDialogue = new FlxTypeText(FlxG.width*0.15, FlxG.height*0.55, Std.int(FlxG.width * 0.4), "", 26);
dropText = new FlxText((FlxG.width*0.15) + 2, (FlxG.height*0.55) + 2, Std.int(FlxG.width * 0.4), "", 26);
} else {
dropText = new FlxText(242, 502, Std.int(FlxG.width * 0.72), "", 32);
swagDialogue = new FlxTypeText(240, 500, Std.int(FlxG.width * 0.72), "", 32);
Expand Down
4 changes: 2 additions & 2 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1362,12 +1362,12 @@ class PlayState extends MusicBeatState
camGame.zoom = 1.8;
camHUD.setPosition(150, 40);
case 4: // iPhone XR
camGame.zoom = 1.6;
camGame.zoom = 1.2;
camHUD.setPosition(130, 20);
case 5: // iPads
camGame.zoom = 1.6;
case 6: // iPhone 11 pro, etc
camGame.zoom = 1.8;
camGame.zoom = 1.5;
camHUD.setPosition(150, 40);
}

Expand Down
17 changes: 11 additions & 6 deletions source/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ class TitleState extends MusicBeatState

super.create();

VirtualPadCamera.VPadCamera();
add(VirtualPadCamera._pad);
VirtualPadCamera._pad.cameras = [camHUD];

// NGio.noLogin(APIStuff.API);

// #if ng
Expand Down Expand Up @@ -100,6 +96,13 @@ class TitleState extends MusicBeatState
#else
startIntro();
#end

#if !mobile
VirtualPadCamera.VPadCamera();
add(VirtualPadCamera._pad);
VirtualPadCamera._pad.cameras = [camHUD];
#end

}

var logoBl:FlxSprite;
Expand Down Expand Up @@ -263,7 +266,7 @@ class TitleState extends MusicBeatState
var pressedEnter:Bool = false;

#if !mobile
if (FlxG.keys.justPressed.ENTER == true) {
if (FlxG.keys.justPressed.ENTER == true || VirtualPadCamera._pad.buttonA.justPressed) {
pressedEnter = true;
}
#end
Expand Down Expand Up @@ -342,7 +345,9 @@ class TitleState extends MusicBeatState

super.update(elapsed);

camHUD.zoom = Std.parseFloat(VirtualPadCamera._gameZoomSave.data.zoomVar);
#if !mobile
camHUD.zoom = Std.parseFloat(VirtualPadCamera._gameZoomSave.data.zoomVar);
#end
}

function createCoolText(textArray:Array<String>)
Expand Down
59 changes: 30 additions & 29 deletions source/VirtualPadCamera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,32 @@ class VirtualPadCamera extends FlxState

trace(_gameSaveCounter.data.counter);

trace('gamezoomsave is ' + _gameZoomSave.data.zoomVar);

if (screenX == 1136 && screenY == 640) { // SE
iOSDevice = 1;
}
if (screenX == 2436 && screenY == 1125) { // X/XS/iP11
iOSDevice = 2;
}
if ((screenX == 1334 && screenY == 750) || (screenX == 1138 && screenY == 639)) { //6/7/8/SE2
iOSDevice = 3;
}
if ((screenX == 1792 && screenY == 828) || (screenX == 1624 && screenY == 750)) { //XR/11
iOSDevice = 4;
}
if ((screenX == 2688 && screenY == 1242) || (screenX == 2532 && screenY == 1170) || (screenX == 2340 && screenY == 1080) || (screenX == 2788 && screenY == 1284)) { // XS MAX/11 PRO MAX/12/12PRO/12promax/12 mini ???
iOSDevice = 6;
}
if (screenY/screenX >= 0.62 && screenY/screenX <= 0.8) {
iOSDevice = 5;
}
if (FlxG.width == 1280 && screenY == 720) {
}

if (_gameSaveCounter.data.counter == null) {
// iPhone 5s/SE
if (screenX == 1136 && screenY == 640) {
if (iOSDevice == 1) {
_gameSave.data.dPadX = 300;
_gameSave.data.dPadY = -155;
_gameZoomSave.data.zoomVar = 2.0;
Expand All @@ -73,7 +96,7 @@ class VirtualPadCamera extends FlxState
_gameZoomSave.flush(); // save
}
// iPhone X
if (screenX == 2436 && screenY == 1125) {
if (iOSDevice == 2) {
_gameSave.data.dPadX = 950;
_gameSave.data.dPadY = -430;
_gameZoomSave.data.zoomVar = 3.9;
Expand All @@ -84,7 +107,7 @@ class VirtualPadCamera extends FlxState
_gameZoomSave.flush(); // save
}
// iPhone 6/7/8/SE2 or SE with modded resolution?
if ((screenX == 1334 && screenY == 750) || (screenX == 1138 && screenY == 639)) {
if (iOSDevice == 3) {
_gameSave.data.dPadX = 400;
_gameSave.data.dPadY = -220;
_gameZoomSave.data.zoomVar = 2.35;
Expand All @@ -95,7 +118,7 @@ class VirtualPadCamera extends FlxState
_gameZoomSave.flush(); // save
}
// iPhone XR/11
if ((screenX == 1792 && screenY == 828) || (screenX == 1624 && screenY == 750)) {
if (iOSDevice == 4) {
_gameSave.data.dPadX = 460;
_gameSave.data.dPadY = -210;
_gameZoomSave.data.zoomVar = 2.15;
Expand All @@ -105,8 +128,8 @@ class VirtualPadCamera extends FlxState
_gameSave.flush(); // save
_gameZoomSave.flush(); // save
}
// iPhone XS/11 Pro Max
if (screenX == 2688 && screenY == 1242) {
// iPhone XS/11 Pro Max/etc
if (iOSDevice == 6) {
_gameSave.data.dPadX = 950;
_gameSave.data.dPadY = -440;
_gameZoomSave.data.zoomVar = 4.0;
Expand All @@ -117,7 +140,7 @@ class VirtualPadCamera extends FlxState
_gameZoomSave.flush(); // save
}
// iPads (should cover most if not all ipads??? maybe???????)
if (screenY/screenX >= 0.62 && screenY/screenX <= 0.8) {
if (iOSDevice == 5) {
_gameSave.data.dPadX = 650;
_gameSave.data.dPadY = -490;
_gameZoomSave.data.zoomVar = 2.6;
Expand All @@ -143,28 +166,6 @@ class VirtualPadCamera extends FlxState
_gameSaveCounter.flush();
}

trace('gamezoomsave is ' + _gameZoomSave.data.zoomVar);

if (screenX == 1136 && screenY == 640) {
iOSDevice = 1;
}
if (screenX == 2436 && screenY == 1125) {
iOSDevice = 2;
}
if ((screenX == 1334 && screenY == 750) || (screenX == 1138 && screenY == 639)) {
iOSDevice = 3;
}
if ((screenX == 1792 && screenY == 828) || (screenX == 1624 && screenY == 750)) {
iOSDevice = 4;
}
if (screenX == 2688 && screenY == 1242) {
iOSDevice = 6;
}
if (screenY/screenX >= 0.62 && screenY/screenX <= 0.8) {
iOSDevice = 5;
}
if (FlxG.width == 1280 && screenY == 720) {
}
_pad.dPad.setPosition(_gameSave.data.dPadX, _gameSave.data.dPadY);
_pad.actions.setPosition(_gameZoomSave.data.actionsX, _gameZoomSave.data.actionsY);
}
Expand Down

0 comments on commit d7273d5

Please sign in to comment.