#Layers Anyone??
9 messages in this thread
I'm trying to set a smaller area in an Intuition window to render
text to. I want the text to remain "clipped" into a specified rectangle.
I looked in the documentation and see no function that can set up a
clipped region. I assume that I must use the Layers routines.
Because I never used the Layers routines, I have a few questions
related to the Layers library.
#1. Because I'm using Intuition, I would like to know if I still have
to open the Layers Library? Or does Intuition do that for you.
#2. I assume that I do the following sequence of calls:
a) NewLayerInfo – To get our Layer structure
b) CreateLayerInfo – Get a pointer to an initialized Layer
structure.
( The RKM says that I'm supposed to do "LockLayerInfo()"
call when using this function, But I see NO examples
that call "LockLayerInfo()".
c) CreateUpfrontLayer() – According to RKM, is supposed to specify
the area on the screen where the layer is supposed to be. It
also says that I'm supposed to give it a pointer to a
"common BitMap used by all layers. Now, Where is this so
called "common bitmap?", there is ABSOLUTLY NO DOCUMANTATION
that explains this. do I:
#1. declare a bitmap structure and point to it?
#2. get the bitmap from the ClipRect pointed to by the
ClipRect field in the Layer structure pointed to by the
WLayer field in the Window structure??
#3. Or get the bitmap from some other place??
Using the RastPort from the newly created "Layer" structure,
I happily render all my stuff in there without messing up any
gadgets that happen to be laying around. Which leads to my next
question.
#3. Do the Coordinates reference to the ULC of the new Layer area,
or are they referenced from the ULC of the Intuition Window?
(ULC = Upper Left Corner).
NOTE: Naturally, I didn't mention above, but I assume that I must
a) DeleteLayer
b) DisposeLayerInfo
< in that order – before exiting >
I would appreciate a prompt reply, as I only have one more week to
go in my Amiga programming vacation, and would like something to show
for all my work. And everyone will eventually appreciate what I'm doing.
Crunch – Programmers Network
WELL: crunch
UUCP: ihnp4!ptsfa!well!crunch
BIX: crunch
CIS: 76703,4322
/ex
Cap'n:
If you attach a console to the window, you can then send commands that set
the LEFT OFFSET, TOP OFFSET, LINE LENGTH and PAGE LENGTH for any text sent to
the window thru the console. LINE LENGTH is given in # of characters rather
than pixels, based on the current font, so you won't get half a character as
clipping might do. The offsets are in pixels relative to the window.
—Mike
I'm not using the console, I'm working on a high performance productivity
tool, and I'm using Intuition.
I'm really looking for a few un-resolved areas where documentation fails
to completly describe how to use it.
Why don't you use the console? What's a "high performance productivity tool"
anyway?
When an intuition function doesn't do exactly what I want, I just code it
myself. I've come up with a file requester scheme that looks like each
filename is in it's own gadget, but I don't use gadgets. I just code it to
behave like a gadget. You could do the same (assuming, of course, that the easy
ways fail <grin>).
There are certainly more than a "few" un-resolved" areas in the docs! The
hardware manual says that one of the parellel port signals can be used to
generate an interrupt (!!!), but I can't find out why in any of the copious
documentation I possess. —Mike
I believe that you want to use the (new to 1.2) function AddClipRect (not 100%
sure about name).
There are several reasons why I don't want to use the console. One of which
is performance. I would rather work directly with IDCMP messages than to
shoot serial data streams to the console input. I would prefer to code it
myself like you mentioned, It's just that VERY LITTLE dosumentation exists
that explain a simple way to deal with clipping rectangles.
Actually, what I'm trying to do is to smooth scroll text in a smaller section
of an ordinary Intuition window. The smaller area (smooth scrolling part)
is surrounded by gadgets, so a strict clipping rectangle is in order.
I'm trying to use the Layers in SuperBitmap mode because I have access to the
scrolling routines which are VERY FAST. Remember, I'm after PERFORMANCE!!
(sigh) the search goes on……
Crunch
That is THE problem with the Amiga, getting maximum performance. You can do
anything with the built-in routines, which is wonderful, but there isn't enough
documentation to do things efficiently.
If I were you (and had the time), I would write a routine that writes
directly to the bitmap, and code my own clipping routines. I'm going to do at
least the former when I have time, like perhaps next year. Good luck! —Mike
Yea!! The Amiga has been out for 2 years and I'm completly blown away by the
fact that NO ONE has EVER written any layer stuff using Intuition.
WHY!!!
Crunch
John, read msg #46595. —Mike