Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile-Cn-Ko-En
Commits
b334e11d
Commit
b334e11d
authored
Sep 21, 2021
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
尺寸
parent
34d96ae1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
3 deletions
+21
-3
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
.../src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
+10
-1
mobile/src/main/java/cn/garymb/ygomobile/App.java
mobile/src/main/java/cn/garymb/ygomobile/App.java
+10
-0
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+0
-1
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+1
-1
No files found.
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
View file @
b334e11d
...
...
@@ -12,6 +12,7 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.pm.ActivityInfo
;
import
android.content.res.Resources
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
...
...
@@ -236,9 +237,14 @@ public class YGOMobileActivity extends NativeActivity implements
//调整padding
float
xScale
=
app
().
getXScale
();
float
yScale
=
app
().
getYScale
();
float
sw
=
app
().
getScreenWidth
();
float
sh
=
app
().
getScreenHeight
();
int
w
=
(
int
)
(
app
().
getGameWidth
()
*
xScale
);
int
h
=
(
int
)
(
app
().
getGameHeight
()
*
yScale
);
Log
.
i
(
"kk"
,
"w1="
+
app
().
getGameWidth
()
+
",h1="
+
app
().
getGameHeight
()
+
",w2="
+
w
+
",h2="
+
h
+
",xScale="
+
xScale
+
",yScale="
+
yScale
);
Log
.
i
(
IrrlichtBridge
.
TAG
,
"game size="
+
app
().
getGameWidth
()
+
"x"
+
app
().
getGameHeight
()
+
", surface="
+
w
+
"x"
+
h
+
", screen="
+
sw
+
"x"
+
sh
+
", xScale="
+
xScale
+
",yScale="
+
yScale
);
return
new
int
[]{
w
,
h
};
}
...
...
@@ -264,6 +270,7 @@ public class YGOMobileActivity extends NativeActivity implements
int
h
=
size
[
1
];
mLayout
=
new
FrameLayout
(
this
);
FrameLayout
.
LayoutParams
lp
=
new
FrameLayout
.
LayoutParams
(
w
,
h
);
mLayout
.
setBackgroundColor
(
Color
.
BLACK
);
lp
.
gravity
=
Gravity
.
CENTER
;
if
(
USE_SURFACE
)
{
mLayout
.
addView
(
mSurfaceView
,
lp
);
...
...
@@ -514,6 +521,8 @@ public class YGOMobileActivity extends NativeActivity implements
if
(!
replaced
)
{
return
;
}
// int[] size = getGameSize();
// holder.setFixedSize(size[0], size[1]);
}
super
.
surfaceCreated
(
holder
);
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/App.java
View file @
b334e11d
...
...
@@ -64,6 +64,16 @@ public class App extends GameApplication {
public
float
getYScale
()
{
return
AppsSettings
.
get
().
getYScale
(
getGameWidth
(),
getGameHeight
());
}
//
// @Override
// public int getGameHeight() {
// return 720;
// }
//
// @Override
// public int getGameWidth() {
// return 1280;
// }
@Override
public
String
getCardImagePath
()
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
b334e11d
...
...
@@ -172,7 +172,6 @@ public class AppsSettings {
int
ret
=
Math
.
min
(
w
,
h
);
//测试代码,曲面屏左右2变需要留空白,但是游戏画面比例不对,需要修改c那边代码
int
fix_h
=
mSharedPreferences
.
getInt
(
PREF_WINDOW_TOP_BOTTOM
,
DEF_PREF_WINDOW_TOP_BOTTOM
);
Log
.
i
(
IrrlichtBridge
.
TAG
,
"get width="
+
ret
+
"->"
+
(
ret
-
fix_h
*
2
));
return
ret
-
fix_h
*
2
;
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
b334e11d
...
...
@@ -119,7 +119,7 @@ public interface Constants {
//dp单位,游戏高度减少,留空白
String
PREF_WINDOW_TOP_BOTTOM
=
"pref_settings_window_top_bottom"
;
int
DEF_PREF_WINDOW_TOP_BOTTOM
=
5
0
;
int
DEF_PREF_WINDOW_TOP_BOTTOM
=
0
;
int
REQUEST_CUT_IMG
=
0x1000
+
0x10
;
int
REQUEST_CHOOSE_FILE
=
0x1000
+
0x20
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment