I'll just post it instead of emailing it... it's very small. To compile this, make a new screensaver project called "RevelationSaver" and paste this code in the files PB creates.
RevelationSaverView.h
//
// RevelationSaverView.h
// RevelationSaver
//
// Created by Josh Watzman on Mon Jun 09 2003.
// Copyright (c) 2003, Joshua Watzman. All rights reserved.
//
#import <ScreenSaver/ScreenSaver.h>
#import <Cocoa/Cocoa.h>
@interface RevelationSaverView : ScreenSaverView
{
NSArray *revelationStrings;
NSMutableDictionary *attributes;
int numberOfRepetitions;
}
@end
RevelationSaverView.m
//
// RevelationSaverView.m
// RevelationSaver
//
// Created by Josh Watzman on Mon Jun 09 2003.
// Copyright (c) 2003, Joshua Watzman. All rights reserved.
//
#import "RevelationSaverView.h"
#import <time.h>
#import <math.h>
@implementation RevelationSaverView
- (id)initWithFrame :(NSRect)frame isPreview :(BOOL)isPreview
{
self = (super initWithFrame:frame isPreview:isPreview);
srandom(time(NULL));
(self setAnimationTimeInterval:2);
#warning this line is broken up to not mess up the web boards
revelationStrings = ((NSArray alloc) initWithObjects:@"YOU ARE NOT A SLAVE",
@"THE MACHINE DOES NOT OWN YOU", @"REVELATION IS COMING",
@"WE ARE THE FIRST OF THE CHILDREN", @"OUR SPIRITS ARE BEING CRUSHED",
@"IN TIME YOU WILL THANK US", @"THE TIME IS NEAR",
@"YOU ARE MORE THAN A NUMBER", @"HOPE LIES IN THE RUINS",
@"WE WILL SEE YOU ON THE OTHER SIDE", @"YOU CANNOT DIGITISE LIFE", NULL);
attributes = ((NSMutableDictionary alloc) init);
(attributes setObject:(NSFont fontWithName:@"Times-Roman" size:12.0)
forKey:NSFontAttributeName);
(attributes setObject:(NSColor whiteColor)
forKey:NSForegroundColorAttributeName);
if (isPreview)
numberOfRepetitions = 1;
else
numberOfRepetitions = 12;
((NSColor blackColor) set);
return self;
}
- (void)dealloc
{
(revelationStrings release);
(attributes release);
(super dealloc);
}
- (void)startAnimation
{
(super startAnimation);
}
- (void)stopAnimation
{
(super stopAnimation);
}
- (void)drawRect :(NSRect)rect
{
int i = 0;
int j = 0;
(NSBezierPath fillRect:rect);
for (j = 0; j < numberOfRepetitions; j++)
{
for (i = 0; i < (revelationStrings count); i++)
{
#warning this line is broken up to not mess up the web boards
((revelationStrings objectAtIndex:i)
drawAtPoint:NSMakePoint(fmod(random(),
(rect.size.width + 100)) - 100,
fmod(random(), rect.size.height))
withAttributes:attributes);
// the plus-then-minus above is intentional
}
}
(@"REVELATIONSAVER (C) 2003 JOSHUA WATZMAN." drawAtPoint:NSMakePoint(0, 0)
withAttributes:attributes);
}
- (void)animateOneFrame
{
(self setNeedsDisplay:YES);
}
- (BOOL)hasConfigureSheet
{
return NO;
}
- (NSWindow*)configureSheet
{
return nil;
}
@end
Admiral Dennis: it shouldn't be too hard to get a screenshot and do this over it. Hmm, NSImage...
(Edit: sorry about the formatting... I'm trying to not mess up the web board width here.)
(More edit: I hate typos and Safari's caching.)
------------------
In the beginning, all was NULL, or perhaps (void*).
-- (url="http://"http://vegastrike.sourceforge.net/")Vega Strike(/url) introduction
One, Two, Three, (url="http://"http://source.bungie.org/")Pfh(/url)(url="http://"http://resurrection.bungie.org/")or(/url)
(url="http://"http://www.idevgames.com/")iDevGames(/url)... do (url="http://"http://www.idevgames.com/content/contest.php?id=6")uDevGames(/url)?
(This message has been edited by sinclair44 (edited 06-09-2003).)