Hello, I am using lispbuilder-SDL and I have been wondering about a
something for some time now.
If we look in the lispbuilder-sdl manual:
get-position object => result
AND
get-position (object sdl-surface) => result
What is the "object"? Let's say I want to move my surface. I first
have to get it's location, but I am stumped...
None of the examples use this function neither.
Thanks for any help :)
·········@gmail.com wrote:
> Hello, I am using lispbuilder-SDL and I have been wondering about a
> something for some time now.
> If we look in the lispbuilder-sdl manual:
>
> get-position object => result
> AND
> get-position (object sdl-surface) => result
>
> What is the "object"? Let's say I want to move my surface. I first
> have to get it's location, but I am stumped...
> None of the examples use this function neither.
>
> Thanks for any help :)
<cough> This is Lisp, why don't you run it and see?:
(format t "~&get-position on ~a returns ~a"
my-surface (get-position my-surface))
Perhaps you are thrown by the formatting of their documentation?
Something like:
get-position (object sdl-surface)
...documents:
(defmethod get-position ((object sdl-surface))
(...whatever...))
ie, They are not talking about two different parametrs (1) object and
(2) sdl-surface, altho it sure looks that way.
kt
ps. Fair warning, i do not actually use cl-sdl, but I did go look at
their doc before answering. k
--
http://www.theoryyalgebra.com/
"In the morning, hear the Way;
in the evening, die content!"
-- Confucius
On Nov 25, 7:09 pm, Ken Tilton <···········@optonline.net> wrote:
> ·········@gmail.com wrote:
> > Hello, I am using lispbuilder-SDL and I have been wondering about a
> > something for some time now.
> > If we look in the lispbuilder-sdl manual:
>
> > get-position object => result
> > AND
> > get-position (object sdl-surface) => result
>
> > What is the "object"? Let's say I want to move my surface. I first
> > have to get it's location, but I am stumped...
> > None of the examples use this function neither.
>
> > Thanks for any help :)
>
> <cough> This is Lisp, why don't you run it and see?:
>
> (format t "~&get-position on ~a returns ~a"
> my-surface (get-position my-surface))
>
> Perhaps you are thrown by the formatting of their documentation?
> Something like:
>
> get-position (object sdl-surface)
>
> ...documents:
>
> (defmethod get-position ((object sdl-surface))
> (...whatever...))
>
> ie, They are not talking about two different parametrs (1) object and
> (2) sdl-surface, altho it sure looks that way.
>
> kt
>
> ps. Fair warning, i do not actually use cl-sdl, but I did go look at
> their doc before answering. k
>
> --http://www.theoryyalgebra.com/
>
> "In the morning, hear the Way;
> in the evening, die content!"
> -- Confucius
Thanks,
yes it seemed to me that it also requires some weird "object" besides
the surface.
Thanks again :)
kuratkull
On Nov 25, 9:48 am, ·········@gmail.com wrote:
> On Nov 25, 7:09 pm, Ken Tilton <···········@optonline.net> wrote:
>
> > ·········@gmail.com wrote:
> > > get-position object => result
> > > AND
> > > get-position (object sdl-surface) => result
>
> > > What is the "object"? Let's say I want to move my surface. I first
> > > have to get it's location, but I am stumped...
> > > None of the examples use this function neither.
>
> > > Thanks for any help :)
>
> > Perhaps you are thrown by the formatting of their documentation?
> > Something like:
>
> > get-position (object sdl-surface)
>
> > ...documents:
>
> > (defmethod get-position ((object sdl-surface))
> > (...whatever...))
>
> > ie, They are not talking about two different parametrs (1) object and
> > (2) sdl-surface, altho it sure looks that way.
>
> yes it seemed to me that it also requires some weird "object" besides
> the surface.
Pass GET-POSITION a SURFACE or a RECTANGLE to return an object of type
POINT containing the X and Y coords of the SURFACE or RECTANGLE.
For example:
(setf *a-surface* (sdl:create-surface 50 50))
(setf *b-surface* (sdl:create-surface 50 50))
(setf (sdl:x *a-surface*) 20)
(sdl:y *a-surface*) 30)
(sdl:set-surface *b-surface* (sdl:get-position *a-surface*))
"get-position object => result"
This is the doc string for the generic function.
"get-position (object sdl-surface) => result"
This is the doc string for the defmethod specializing on SDL-SURFACE.
"get-position (object rectangle) => result"
This is the doc string for the defmethod specializing on RECTANGLE.
The documentation is generated from the documentation strings using
Edi Weitz's DOCUMENTATION-TEMPLATE, and Gary King's CL-MARKDOWN.
- http://www.weitz.de/documentation-template/
- http://common-lisp.net/project/cl-markdown/
- Luke
On Nov 27, 3:19 am, Luke Crook <····@balooga.com> wrote:
> (sdl:set-surface *b-surface* (sdl:get-position *a-surface*))
SET-SURFACE and SET-POSITION do the same thing. I'm going to delete
SET-SURFACE from the svn repo.
So then;
(sdl:set-position *b-surface* (sdl:get-position *a-surface*))
- Luke