在特定层中进行Box2D调试绘制 [英] Box2D debug draw in a specific layer

查看:87
本文介绍了在特定层中进行Box2D调试绘制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文章讲述如何在一个图层中包装Box2D调试绘图.但我不明白为什么要在特定图层上绘制它.就我不了解OpenGL而言,我根本不了解它在哪里绘制.但是我的问题是我想绘制一个特定的图层,以便可以将该图层放在所有图层之上,并使Box2D形状始终可见.

This article tell how to wrap Box2D debug draw in a layer. But I do not understand why it is being drawn in the specific layer. As far as I don't know OpenGL, I don't understand where it is being drawn at all. But my problem is that I want to draw in a specific layer, so that I could put that layer on top of all layers and make Box2D shapes always visible.

今天,我发现了

Today I have found the solution how to do debug draw Box2D shapes in C++ but I cannot draw in a specific layer. Could you help me understand where it is being drawn so I could draw the Box2D shapes on top of my sprites. I want to bring them front.

推荐答案

您可以简单地在当前图层之上添加另一个图层.

You could simply add another layer above your current layer.

您可以将您在此处发布的代码添加到上层,然后一切正常.

And you can add the code you post here in the up layer then everything should be working.

这篇关于在特定层中进行Box2D调试绘制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆