在过去的几周里,我一直在尝试学习libGDX库.我发现很难,尤其是我第一次尝试游戏开发时,要理解相机/视口关系系统.我被告知使用的一行代码和API提到的是:
batch.setProjectionMatrix(camera.combined);
Run Code Online (Sandbox Code Playgroud)
尽管进行了4个小时的研究,但我仍然缺乏对此代码功能的完整理解.根据我的基本理解,它"告诉"相机正在寻找的批次.我缺乏理解力令人沮丧和愤怒,如果有人能帮助我,我会很感激.代码片段的另一个问题是我不确定何时需要实现(在render方法中,create方法等).
所以我现在设计一个网站(漂亮nooby在HTML和CSS),但我做了一个Photoshop的预先设计,这样我可以通过编码右转,使网站,我想怎样.好吧,我有一个问题.尽管使用了内联块,我在一个更大的容器DIV内部有两个DIV元素,它们不会并排排列.这是css代码:
.contentContainer {
display: block;
width: 700px;
height: 250px;
margin: 20px auto;
}
.topContainer {
height: 230px;
padding: 10px;
background-color: white;
}
.topThumbnail {
display: inline-block;
width: 370px;
height: 230px;
}
.topThumbnail img {
width: 370px;
height: 230px;
}
.topInfo {
display: inline-block;
margin-left: 10px;
width: 300px;
height: 230px;
}
.topInfo p {
width: 300px;
height: 230px;
background-color: pink;
}
Run Code Online (Sandbox Code Playgroud)
该contentContainer最高DIV抱着我topContent和topThumbnail,所以我想我应该把它扔进所提供的代码.和HTML代码:
<div class="topContainer">
<div class="topThumbnail">
<img src="YT.png" />
</div>
<div class="topInfo">
<p>Testing the information area of the top container or …
Run Code Online (Sandbox Code Playgroud)