[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

4039.0. "Sprite/Window/Screen Programming (Call all techies)" by BIGIST::SYSTEM () Wed Aug 22 1990 09:47

    
    
    
    Dear All , 
    
    Am trying my hand at writing an amiga game, mostly C with a few bits
    of assembler here and there. I hope there is somebody who can point
    out where I am going wrong. (Firstly please dont point me to a "good"
    book on the subject as I have about 4)
    
    	What I have is and overscan screen set up with a window opened
    on it (at 30,30) The window is a superbitmap onto a game map below.
    	This setup is no problem and I can scroll the bitmap around quite
    nicely behind the window. The problem is to do with sprites. I want to
    use a sprite as a cursor and make it relative to the window, but
    whatever I do, its position is still only relative to the origin of
    the screen. How do I use a sprite relative to a window? (Have tried
    using ViewPortblahblah(mywindow) to give me the VP for ChangeSprite
    and MoveSprite but it still dont work! Any pointers (excuse the pun)
    much appreciated. (Maybe if you know A "really good" book
    Ill go for it)
    
     OK I know this is horribly techie but Im losing my patience with
    this one. 
    
    	
     
T.RTitleUserPersonal
Name
DateLines
4039.1Sprites don't live in windowsWBC::BAKERWhatever happened to Fay Wrey...Wed Aug 22 1990 19:2414
>    	This setup is no problem and I can scroll the bitmap around quite
>    nicely behind the window. The problem is to do with sprites. I want to
    use a sprite as a cursor and make it relative to the window, but
>    whatever I do, its position is still only relative to the origin of
>    the screen. How do I use a sprite relative to a window? (Have tried
 				^^^^^^^^^^^^^^^^^^^^^^^^^^^^

	Sprites, by definition, live in front of all windows on the screen,
	hence their coordinate system is always screen-based.  If you want
	to use window-relative coordinates to move the sprite, I'm afraid
	you'll have to grab the coordinates of the window and do the
	transform yourself.

	~art