GameEngine2D

Reply
Accepted Solution

Primitive Shapes in GameEngine2D

Hi there,

 

Is it possible to draw primitive shapes easily in GameEngine2D? Rects, circles, lines?

 

Cheers!

Please use plain text.

Re: Primitive Shapes in GameEngine2D

Hi CeeBee2012,

 

Thanks for your question. Unfortunatley there are no GE2D Nodes that will help you to achieve this, however GE2D has some DrawHelpers which may help you to achieve what you are after. An example of using the DrawHelpers are below. 

 

ge_scene.AdHocDraw += () => 
{
	Director.Instance.DrawHelpers.DrawLineSegment(new Vector2(100, 100), new Vector2(500, 500));
};

 

You should be aware however that DrawHelpers should be used only for debugging purposes as they are not geared for performance. 

 

Hope this helps.

 

James

PlayStation®Mobile Dev Team
Please use plain text.

Re: Primitive Shapes in GameEngine2D

Thanks!

Please use plain text.

Level 2

Level 2
Nikoomba
Posts: 10
Registered: ‎05-02-2013
Message 4 of 4 (103 Views)

Re: Primitive Shapes in GameEngine2D

I've used the posted code but can't get it to work.

 

Everything compiles normally, and if I do a lot of these calls in the update loop I even notice lag, but I can't see any of the primitives I'm drawing.

 

Any guess as to what I'm doing wrong?

Please use plain text.
Announcements

Welcome to the PlayStation Mobile Developer Forums


This is a community for the discussion of technical topics with other developers and SCE engineers. Posting ideas/requests are also appreciated. Join the discussion!

PlayStation®Mobile開発者フォーラムでは世界中の開発者の皆様と一緒に、議論や情報交換が可能です。SCEも議論に参加し、皆様の開発をサポートします。アイデアやリクエストも大歓迎です。ぜひご参加ください。

PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.

フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと PSM DevPortalを一度ログアウトし、再度ログインしてください。