Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Mouse-following text
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
iker




PostPosted: Thu Feb 02, 2006 9:35 pm   Post subject: Mouse-following text

I was just screwing around on turing and made this. Don't realy know why or if theres a purpose for it, but i made it...
Works best if you have the megadeth cryptic font installed on your computer, which you can get here
I'm thinking of making something out of this, but dont realy know what yet. Any suggestions would be appreciated



Mouse Follow.rar
 Description:
Download winrar if you don't have it.

Download
 Filename:  Mouse Follow.rar
 Filesize:  348.19 KB
 Downloaded:  217 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
tupac




PostPosted: Fri Feb 17, 2006 12:29 am   Post subject: (No subject)

wow, thats pretty good, i especially like how the names change when u go from grup member to grup member Smile
Good Job!
Clayton




PostPosted: Fri Feb 24, 2006 9:40 am   Post subject: (No subject)

i would like to ask what you did to get the names to change from person to person, and in the actual shape of the person too. did u use a whatdotcolor type of thing or what?
iker




PostPosted: Fri Feb 24, 2006 8:14 pm   Post subject: (No subject)

I used drawfillpolygon and whatdotcolor on each of the band members. I actualy had another program to make the shapes for the polygons around the band members by clicking and whatnot, but yah, I guess I'll post the source for this program since I'm not realy using it

code:
var x, y, button, pic : int := Pic.FileNew ("Pics/band.jpg")
var font := Font.New ("megadeth:20")
var glow := Font.New ("megadeth:25")
var WORDX, WORDY : array 1 .. 8 of int
for i : 1 .. 8
    WORDX (i) := 500
    WORDY (i) := 500
end for
type Person :
    record
        MX, MY : array 1 .. 100 of int
    end record
var FRI, MUS, DEG, ELL : Person
var fileNo, Colour : int
open : fileNo, "FRI.AMP", read
read : fileNo, FRI
open : fileNo, "MUS.AMP", read
read : fileNo, MUS
open : fileNo, "DEG.AMP", read
read : fileNo, DEG
open : fileNo, "ELL.AMP", read
read : fileNo, ELL
setscreen ("graphics:max;max,offscreenonly,nobuttonbar,position:center;center")
loop
    Mouse.Where (x, y, button)
    Pic.Draw (pic, 0, 0, picCopy)
    Draw.FillPolygon (FRI.MX, FRI.MY, 17, 39)
    Draw.FillPolygon (MUS.MX, MUS.MY, 24, 40)
    Draw.FillPolygon (DEG.MX, DEG.MY, 20, 41)
    Draw.FillPolygon (ELL.MX, ELL.MY, 15, 42)
    Colour := View.WhatDotColour (x, y)
    Pic.Draw (pic, 0, 0, picCopy)
    if Colour = 39 then
        for i : 1 .. 8
            WORDX (i) += (x - WORDX (i)) div i
            WORDY (i) += (y - WORDY (i)) div i
            Font.Draw ("Friedman" (8 + 1 - i), WORDX (i) - (20 * i) - 2, WORDY (i) - 2, glow, brightred)
            Font.Draw ("Friedman" (8 + 1 - i), WORDX (i) - (20 * i), WORDY (i), font, black)
        end for
    elsif Colour = brightred then
        for i : 1 .. 8
            WORDX (i) += (x - WORDX (i)) div i
            WORDY (i) += (y - WORDY (i)) div i
            Font.Draw ("Mustaine" (8 + 1 - i), WORDX (i) - (20 * i) - 2, WORDY (i) - 2, glow, brightred)
            Font.Draw ("Mustaine" (8 + 1 - i), WORDX (i) - (20 * i), WORDY (i), font, black)
        end for
    elsif Colour = 41 then
        for i : 1 .. 5
            WORDX (i) += (x - WORDX (i)) div i
            WORDY (i) += (y - WORDY (i)) div i
            Font.Draw ("Menza" (5 + 1 - i), WORDX (i) - (20 * i) - 2, WORDY (i) - 2, glow, brightred)
            Font.Draw ("Menza" (5 + 1 - i), WORDX (i) - (20 * i), WORDY (i), font, black)
        end for
    elsif Colour = 42 then
        for i : 1 .. 8
            WORDX (i) += (x - WORDX (i)) div i
            WORDY (i) += (y - WORDY (i)) div i
            Font.Draw ("Ellefson" (8 + 1 - i), WORDX (i) - (20 * i) - 2, WORDY (i) - 2, glow, brightred)
            Font.Draw ("Ellefson" (8 + 1 - i), WORDX (i) - (20 * i), WORDY (i), font, black)
        end for
    else
        for i : 1 .. 8
            WORDX (i) += (x - WORDX (i)) div i
            WORDY (i) += (y - WORDY (i)) div i
            Font.Draw ("MegadetH" (8 + 1 - i), WORDX (i) - (20 * i) - 2, WORDY (i) - 2, glow, brightred)
            Font.Draw ("MegadetH" (8 + 1 - i), WORDX (i) - (20 * i), WORDY (i), font, black)
        end for
    end if
    View.Update
    Time.DelaySinceLast (10)
    cls
end loop


it reads the polygons from the .amp files, they come with the download so I don't need to repost them. Its actualy a realy simple program, and anyone can freely use this code with recognition please.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: