Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 12,885 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vec_to_screen problem #287919
09/03/09 08:46
09/03/09 08:46
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
Hi,

I want to do is that if the entities/objects in my level are not visible in the screen I don't want to play/move the objects...

Ex. code:
Code:
//--------------------------------------------------------------------
// Action: Cow
//--------------------------------------------------------------------
action act_cow()
{	
  VECTOR vecTemp;
  vec_set(vecTemp.x, my.x);
  var anim_percentage = 0;
  set(my, POLYGON);	
	
  while(1)
  {
    while( vec_to_screen(vecTemp, camera) != NULL) //visible to screen
    {		
	flagCowTest += 1;
	ent_animate(my, "CowEat", anim_percentage, NULL);				
       anim_percentage += 2 * time_step;
       anim_percentage %= 100;
       wait (1);
    }
    wait(1);
   }	
}



But the code above is not working.. I put the "flagCowTest" to know if the cow animation is played and the code is executed.. but when it's already rendered on screen the cow animation code is not executed...

I don't know why? If you have some idea, pls. let me know.
Thanks

Re: vec_to_screen problem [Re: boyax] #287922
09/03/09 09:23
09/03/09 09:23
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
use the CLIPPED eflag to see if the entity is on the screen or not


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1