安卓。搜索/帮助:非常基本的代码“框架”对于自定义视图 +带有一些位图的画布
我一直在这里浏览几个主题,研究蛇和月球发射器,但我仍然不知道如何让我的项目有一个良好的开始项目。 (项目是:将现有的 javascript/xml 游戏移植到 android/Java。)
到目前为止,我发现的所有示例要么对我来说太过遥远,要么只是一些您应该自己集成和定义的代码行(构造函数等)。
我的问题是:我有一个有效的“应用程序逻辑”,但只有“理论”Java知识(学习!)。 em>
我需要的是: 一些代码行(类?)定义一个自定义视图(“customGame”),其中放置了三个位图(“tile1.png”..“tile3.png”)在定义了 X/Y 值的画布上。
这就是全部!
...并且:如果有人也提到一种识别触摸/点击的位图的简单方式/方法,我会高兴。
我有信心/希望从第一步开始找到前进的道路...... 我仍在努力了解 Java 的特性;因此,我无法(还)修复代码中的小错误,而你们大多数人可能会嘲笑!
请:仅发布不依赖于我认识到的明显遗漏的代码。
非常感谢 感谢任何愿意花时间给我这么大恩惠的人!
Clemens(来自德国的平面艺术家)
I have been looking through several topics here, studied snake and lunar launcher but I am still at a loss how to get a sound start for my project. (Project is: porting an existing javascript/xml game to android/Java.)
All examples I found so far are either TOO far going -for me- or just some code lines that you are supposed to integrate and define all by yourself (constructors etc.).
My problem is: I have a working "app logic" but only "theoretic" Java knowledge (learning!).
What I need is: A few code lines (class?) defining a custom view ("customGame") with say three bitmaps ("tile1.png" .. "tile3.png") placed on a canvas with X/Y values defined.
THAT'S REALLY ALL!
...and: I'd be happy if someone also would mention a simple way/method to identify the bitmap touched/clicked.
I feel confident/hopeful to find my way onwards from this first step ...
I am still striving to learn about Java peculiarities; therefore I am not able (yet) to fix minor faults in code that most of you might laugh at!
PLEASE: only post code that won't depend on my recognizing obvious omissions whatsoever.
THANK YOU VERY MUCH to anybody who will spend his time to grant me such a big favor !!!
Clemens (graphic artist from Germany)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于没有人找到我的问题的答案,而且我在另一个论坛上找到了答案,我自己会将我的发现作为“答案”发布在这里 - 这样人们就不会被该线程前面的“0 答案”标志误导。
在 anddev.org 上,Mr.snowflake 提供了一个 2D 教程,它满足了我的需求 - 尽管我更喜欢没有单独线程的教程...
2D 教程(gameTemplate)
再见,克莱门斯
As nobody found an answer for my question AND I found one at another forum, I will post my finding here as an "answer" myself - so people will not be misled by a "0 answers" flag in front of this thread.
There is a 2-D-tutorial at anddev.org by Mr.snowflake that met my needs - although I would have preferred one with no separate thread...
2-D-tutorial (gameTemplate)
See you, Clemens