在iPhone和iPad上查看时,我的网站无法正常显示,我遇到了一些困难.网站(甚至没有完成)是www.lzkconcepts.com.
在我试过的每个桌面浏览器(safari,chrome,firefox,IE)上查看时,网站显示正常,但是,在iPhone/iPad上,"内容"div与页眉和页脚之间存在微小的间隙/空间.我在标题,内容和页脚div中使用背景图像来创建页面的轮廓.除了div之间的间隙之外,内容背景图像有时会"缩小"一点,因此它不会与屏幕右侧的页眉和页脚对齐.如果我放大,一切都完美排列.这是从iPhone上截取的截图...
仔细查看蓝色导航栏下方的右侧.
这是CSS(我知道它非常粗糙,我只是在学习)
@charset "UTF-8";
body {
margin: 0;
padding: 0;
color: #000;
font-family: Arial, Helvetica, sans-serif;
font-size: 100%;
line-height: 1.4;
background-color: #CCC;
}
.TableAppName {
color: #007EB4;
}
/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that …Run Code Online (Sandbox Code Playgroud) 我正在开发iOS游戏,我使用glDrawArrays(使用cocos2D v1.0.1,使用OpenGL ES 1.1)在纹理方面遇到了一些麻烦.我首先创建一个CGPoints数组,定义一个山的顶部和底部,以及一个纹理坐标数组:
hillVertices[nHillVertices] = CGPointMake((topLeftVertexX)*CC_CONTENT_SCALE_FACTOR(), topLeftVertexY*CC_CONTENT_SCALE_FACTOR());
hillTexCoords[nHillVertices] = CGPointMake((topLeftVertexX)/textureSize.width, 0.0);
nHillVerticies++;
hillVertices[nHillVertices] = CGPointMake((bottomLeftVertexX)*CC_CONTENT_SCALE_FACTOR(), bottomLeftVertexY*CC_CONTENT_SCALE_FACTOR());
hillTexCoords[nHillVertices] = CGPointMake(topLeftVertexX)/textureSize.width, 1.0);
nHillVerticies++;
Run Code Online (Sandbox Code Playgroud)
然后用...画画
glBindTexture(GL_TEXTURE_2D, groundSprite.texture.name);
glVertexPointer(2, GL_FLOAT, 0, hillVertices);
glTexCoordPointer(2, GL_FLOAT, 0, hillTexCoords);
glDrawArrays(GL_TRIANGLE_STRIP, 0, (nHillVertices-1));
Run Code Online (Sandbox Code Playgroud)
在游戏开始时(当"topLeftVertexX"值很小时),山丘看起来很好......

但随着游戏的继续,x偏移值(topLeftVertexX)增加,事情开始恶化......

接近尾声,它变坏了......

我认为问题是在游戏开始时,"topLeftVertexX"值很小,所以结果是
(topLeftVertexX)/textureSize.width
Run Code Online (Sandbox Code Playgroud)
在
hillTexCoords[nHillVertices] = CGPointMake((topLeftVertexX)/textureSize.width, 0.0);
Run Code Online (Sandbox Code Playgroud)
是小.然而,随着游戏的继续和x值的增加,我认为价值变得越来越大,导致某种腐败.textureSize为512x512,"topLeftVertexX"在游戏开始时从0开始,最高可达200,000.
我已经尝试增加三角形的数量(包括添加额外的条带),但这没有用.我也试过使用@jpsarda的CCSpriteBiCurve类,得到了相同的结果.我也尝试使用glHints(例如GL_LINE_SMOOTH_HINT和GL_NICEST),但我没有发现任何有用的东西.
我有什么想法可以解决这个问题吗?