I am trying to create an object. But it does not show up... I am using Firemonkey, FMX, C++ Builder. I get no errors, and when I hit Button1 again it says that Test1 is already created..
I can't recall far enough back in time to remember much about builder.
but line 6 bugs me. what type do YOU think "this" is at that point? I think it is a TForm -- some turboism window library object. How is that related to a graphical sphere?
line 9, I do not know what these things are so I can't comment on what you did. Any pointer can be cast to any other pointer. Doing so will let you use it as if it were that thing, but if the cast is not compatible, you could get literally *anything* happening. Eg you can cast an int* as one of your Tcontrol3d things and attempt to mess with its 'position' members, but they are not there, and after you exceed the sizeof int and go off into memory doing random things at random unprovided locations, you have a mess.
if indeed this chunk of code is your problem, its one of those 2 lines.
I think line 6 is okay. The parameter is probably the parent object.
As for line 6, if TSphere derives from TControl3D then you don't need the cast at all. You can access the base class members directly.
Isn't there a member that indicates the height of the object, meaning whether this object is in front of or behind other objects on the form? Make sure that the Sphere isn't hidden behind something else (including the form itself).
Try setting the X & Y positions to 0 just to get it visible.
Did you indicate that the appropriate portion of the form must be redrawn? Do you need to? Like Jonnin, it's been a while since I've used Builder.
Oh! What's going on at line 21?? Isn't the parent the form??
It think my problem is, that the Sphere Object is not connected to the correct TDummy.
I have a structure
Form
-> ViewPort3D
... ->Dummy
...... -> Sphere
then I want to add more Sphere's
-> Sphere1
-> Sphere 2
...
-> Sphere n
Its easy in C++ Builder to construct this in the visual design module - But in my game - I need to make an engine, which creates these Sphere's - but I can't figure out how to let my new Sphere be a "member" of Dummy...