X2D - eXtended 2D

Developed or developing a new product in PureBasic? Tell the world about it.
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

This is my 500th post!!! I would like to celebrate with an useful post, but I just can't figure anything useful right now... Dunno: enjoy life, don't waste your time working for somebody else, wake up at three, eat, drink and f*** as much as you can or someone else will.

All this works for me

Regards, :twisted: :mrgreen: :twisted:
El_Choni
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

OK, can someone please test and confirm the functionality of the newly compiled lib: http://www.physical-touch.de/X2D (attention, no zip, just the plain lib-file)
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

All this works for me
sure....
:P
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

El_Choni wrote: wake up at three, eat, drink and f*** as much as you can or someone else will.
Congrats... and in your quote, you mean fart right.? 8O
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

nice job... it's very usefull

a suggestion:

Code: Select all

imageid = X2D_ExtracAlphaChannel( #ID, PNGfilename.s )
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

I get the following error with the attached code:

The following PureLibrary is missing: TB_INCLUDEFONT

Code: Select all

;===========================================================================
;-CONSTANTS
;===========================================================================

#APP_NAME = "Window Template"

Enumeration
    #WINDOW_ROOT
EndEnumeration

;===========================================================================
;-GLOBAL FLAGS / VARIABLES / STRUCTURES / ARRAYS
;===========================================================================

;Get the background colour of the windows
BackgroundColour = GetSysColor_(#COLOR_3DFACE)

;===========================================================================
;-PROCEDURES
;===========================================================================

;Handle an error
Procedure HandleError(Result, Text.s)
    If Result = 0 : MessageRequester("Error", Text, #PB_MessageRequester_Ok) : End : EndIf
EndProcedure

;===========================================================================
;-MEDIA
;===========================================================================

LoadImage(2, "Passport.bmp")
LoadImage(3, "AlphaChannel.bmp")

;Set the alpha channel to the image
X2D_SetAlphaChannel(UseImage(2), UseImage(3))

;===========================================================================
;-GEOMETRY
;===========================================================================

HandleError(OpenWindow(#WINDOW_ROOT, 0, 0, 400, 300, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, #APP_NAME), "Main window could not be created.")

;Create an image to draw the transparent sprite onto
CreateImage(1, 400, 300)
;Display the image on a gadget
CreateGadgetList(WindowID(#WINDOW_ROOT))
    ImageGadget(1, 0, 0, 400, 300, UseImage(1))

;===========================================================================
;-MAIN LOOP
;===========================================================================

Repeat

    UseImage(1)
    StartDrawing(ImageOutput())
        ;Fill that image with the correct colour to make it look like part of the window
        Box(0, 0, 400, 300, BackgroundColour)
        ;Draw the image containing the alpha channel
        X2D_DrawAlphaImage(UseImage(2), WindowMouseX(), WindowMouseY(), 255, #X2D_AlphaMask)
    StopDrawing()

    SetGadgetState(1, UseImage(1))

    EventID.l = WindowEvent()
    Select EventID

    EndSelect
    Delay(1)
Until EventID = #PB_Event_CloseWindow
End

;===========================================================================
;-BINARY INCLUDES
;===========================================================================
--Kale

Image
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

@Kale: We will have to wait till El_Choni is back from his Europe Roundtrip. I can't even compile the Source anymore under 3.91 ;-)
I think he and I can work on this in september.

@eddy: Good idea.


Thanks for the input guys.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

a aplha extractor would be cool. :)

It's such a pity that PB can't read alpha information :roll:
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

eddy wrote:a aplha extractor would be cool. :)

It's such a pity that PB can't read alpha information :roll:
You mean reading in a PNG and extracting the information of the Alpha-Channel? Could be done, though I don't know how complicated the PNG format is. Have to read the specifications about that.

But it will take it's time, as I'll be away at least one week. I'm flying to Madrid today staying there for 4 months and I don't know when or how I will have the opportunity to go into the internet.
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Hmm... weird problem (about TB_INCLUDEFONT),I ll check it when I m back. Having a great time, right now in Budapest, conmemorating their 1000 annyversary with fireworks, beer, and what not. It s a pity they speak such an odd language Cya
El_Choni
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

El_Choni wrote:Hmm... weird problem (about TB_INCLUDEFONT),I ll check it when I m back. Having a great time, right now in Budapest, conmemorating their 1000 annyversary with fireworks, beer, and what not. It s a pity they speak such an odd language Cya
Anymore news on this im still getting the TB_INCLUDEFONT error. :(
--Kale

Image
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I'm working on it. I had freedimension yesterday sitting just by my side, and he can tell you it's not that easy, but I know how to solve it. It'll be fixed this week.

Regards,
El_Choni
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

El_Choni wrote:I'm working on it. I had freedimension yesterday sitting just by my side, and he can tell you it's not that easy, but I know how to solve it. It'll be fixed this week.

Regards,
ACK, very weird problem. But I'm sure El_Choni will find the answer :)
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

nice :)
--Kale

Image
TheBeck
User
User
Posts: 39
Joined: Mon May 12, 2003 6:04 am
Location: the far west
Contact:

Post by TheBeck »

So this lib is not working at all under 3.91? :cry:

I really need the transparent image function. Any word on when this will be working again?
Nathan Beckstrand -- XPSP2, AMD Athlon XP 3000+, GF2 GTS, 512MB RAM
Post Reply