Adam's Lair Forum

game development and casual madness
It is currently 2020/01/21, 14:34

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: 2015/01/29, 20:19 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
openend wrote:
One more question (I hope you dont get tired of me, many more to come :) )

I did the same with Adam and he resisted, so I guess it's my turn to and try to help :mrgreen:


openend wrote:
I am trying to figure out how to show text at the position of a gameobject. Somehow I have to access the default camera for that, how would I access object in the current scene, or the scene itself? I got as far as to get the cam via gameObj.parentscene but somehow I have no possibility to declare a Camera field?


You can do this:
Code:
Camera camera = this.GameObj.ParentScene.FindComponent<Camera>();

and if you want to have a Camera field, just use
Code:
using Duality.Components;

...

  [Serializable]
  public class MyClass : Component
  {
    public Camera Camera { get; set; }
  }

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/01/29, 20:28 
Novice Member
Novice Member

Joined: 2015/01/27, 11:47
Posts: 11
Location: Germany
Role: Hobbyist
Thanks.

I figured out, that I was just missing an using directive for Duality.Component.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group