Tiel Posted December 9, 2016 Share Posted December 9, 2016 A resource I'm trying to port has the lines // projected point mPtScreen = mPtProj; // alignment offset mPtScreen += offsetAlign; // screen offset mPtScreen += mOffsetScreen; // setTrgPosition(mPtScreen); mBounds.point=mPtScreen; Problem being mBounds is private as of a few years ago. I'm not even going to pretend I'm comfortable with C++, but from what I've gathered this last line is to set the position of the control via mBounds.point (which is the topleftcorner of a ctrl to the best of my knowledge, forgive my ignorance). So getExtent() or getBounds, the replacement for retrieving extents with mBounds, wouldn't exactly work here, as those are functions that return a value, not the other way around.Getting to the point, is there a replacement for mBounds.point? Quote Link to comment Share on other sites More sharing options...
JeffR Posted December 9, 2016 Share Posted December 9, 2016 If you're only trying to set the position of the gui control, you should be able to just call setPosition(mPtScreen);if you poke through gui/core/guiControl.h, that's the header of the root gui object class, and that sucker has a ton of useful utility functions for doing basic stuff like this. Lemme know if that doesn't work, but that should do what you need. Quote Link to comment Share on other sites More sharing options...
Tiel Posted December 9, 2016 Author Share Posted December 9, 2016 Okay, that seemed to please it.Although, if I might go offtopic, I've also been trying to get this guy to work: http://www.garagegames.com/community/forums/viewthread/107847// If we're mounted to them, don't give them anything! ShapeBase* obj = this; while(obj->getObjectMount()) if((SceneObject*)obj->getObjectMount() == convex->getObject()) return; else obj = obj->getObjectMount(); This displeases the compiler:error C2440: '=' : cannot convert from 'SceneObject *' to 'ShapeBase *'What I'm trying to do is mount staticshapes to an AIPlayer but it sounds like the collision's immobilizing them. Quote Link to comment Share on other sites More sharing options...
JeffR Posted December 14, 2016 Share Posted December 14, 2016 That'd be because getObjectMount() returns a sceneObject, which isn't necessarily a ShapeBase object.You'll either want your initial ShapeBase* obj = this; to instead read SceneObject* obj = this;, so you can handle ANY scene object that may be mounted, or if you just assume the only things you'll be mounting are other ShapeBase objects, you can turn that last line into: obj = dynamic_cast<ShapeBase*>(obj->getObjectMount()); Which will try casting obj to a ShapeBase. If one of the mounted objects isn't a shapebase or derived from it, that approach could cause problems/crashes though, so be wary. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.