|
Post by stevev4v on Apr 3, 2005 9:26:56 GMT
I have been tinkering with the sample code and thought I had pretty much figured how how this product works BUT I have run into a problem. This code works fine (but is not really what I need):
Tmp = HUD_CreateImage (Layer4, 0,0, 53,91, 32,32) HUD_PositionObject Tmp, HUD_GetObjectX(Image)+10, HUD_GetObjectY(Image)+50 HUD_SetObjectRotation Tmp, Rand(0,360) HUD_SetObjectScale Tmp, .25,.25 HUD_SetObjectColor Tmp, 100,100,100,.65 HUD_FX_SteadyMove Tmp, 0,Rand(0,-25) HUD_FX_Scale Tmp, 2,2,1500 HUD_FX_AlphaFade Tmp, 0,2000 HUD_FX_AutoRemove Tmp, 2000 ; ...AND BYE
But the code below results in a "The specified HUD does not exist" error.
Tmp = HUD_CreateImage (Layer4, 0,0, 53,91, 32,32) HUD_PositionObject Tmp, HUD_GetCorner(Image,3,0),HUD_GetCorner(Image,3,1) HUD_SetObjectRotation Tmp, Rand(0,360) HUD_SetObjectScale Tmp, .25,.25 HUD_SetObjectColor Tmp, 100,100,100,.65 HUD_FX_SteadyMove Tmp, 0,Rand(0,-25) HUD_FX_Scale Tmp, 2,2,1500 HUD_FX_AlphaFade Tmp, 0,2000 HUD_FX_AutoRemove Tmp, 2000 ; ...AND BYE
Anybody know why?
|
|
Ed-2D
Junior Member
Posts: 59
|
Post by Ed-2D on Apr 3, 2005 12:52:37 GMT
Try GetObjectCoords
|
|
|
Post by stevev4v on Apr 3, 2005 18:36:30 GMT
I did, it doesn't work either.
The point is why does HUD_GetObjectX work fine and HUD_GetCorner does not when used on the exact same HUD?
|
|
tonyg
Junior Member
Posts: 73
|
Post by tonyg on Apr 3, 2005 18:54:48 GMT
Does 'Image' really contain your HUD ID? Hud_GetCorner works with a HUD handle and returns the HUD corner X/Y. This works for me...
Graphics3D 640, 480, 0, 2 : SetBuffer BackBuffer() ;my_timer=CreateTimer(60) ; INCLUDE SPRITE CANDY Include "../sprite candy.bb"
; CREATE CAMERA, LIGHT, BACKGROUND Cam = CreateCamera()
; CREATE THE HUD HUD% = HUD_Create (Cam) Hud_x = HUD_GetCorner(hud,3,0) hud_y = HUD_GetCorner(hud,3,1) Print hud_x + " " + hud_y WaitKey()
|
|
|
Post by stevev4v on Apr 3, 2005 22:28:46 GMT
Okay, that did work. It threw me off that the syntax for GetObjectCoords is different than GetCorner: HUD_GetCorner ( HUD_Handle%, corner%, getY% ) HUD_GetObjectCoords ( Object_Handle%, value$, [corner%] ) Okay, so it seems strange to me that these two commands do basically the same thing except that one works for Huds and the other for objects. Maybe GetObjectCorner and keeping the same syntax would have made more sense. Anyhow, thanks for the help!
|
|
|
Post by Jake on Apr 5, 2005 5:36:52 GMT
Okay, so it seems strange to me that these two commands do basically the same thing except that one works for Huds and the other for objects. Maybe GetObjectCorner and keeping the same syntax would have made more sense. We discussed this point during beta. Because HUD_GetObjectCoords does more than just get a corner of an object, Mike decided to leave it as it is.
|
|