BASIC

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Paul Smith

Pages: 1 ... 3 4 [5] 6 7
61
GLBasic - en / Re: SETTRANSPARENCY question
« on: 2015-Jun-14 »
Gave up on this in the end, I just used alphamode and made the top layer fully transparent. but thanks for the pointers.
Stuck on something else now. when trying to add FMOD to my project I get the error below.The project in the GLB sample folder compiles perfectly and works, but I get these error if I try a add them to my project or If I start a new project add the fmod_player source but cut and paste the player_interface.
probably somthing simple

compiling:
C:\Users\PAULSL~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp: In destructor `__GLBASIC__::FMOD_killer::~FMOD_killer()':
C:\Users\PAULSL~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:34: error: `IF' was not declared in this scope
C:\Users\PAULSL~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:34: error: expected `;' before "FMod_Stop"
C:\Users\PAULSL~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp: In function `DGInt __GLBASIC__::FMod_Load(__GLBASIC__::DGStr)':
C:\Users\PAULSL~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:77: error: `IF' was not declared in this scope
C:\Users\PAULSL~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:77: error: expected `;' before "FSOUND_Init"
C:\Users\PAULSL~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:81: error: expected `;' before "g_pFMod"
C:\Users\PAULSL~1\AppData\Local\Temp\glbasic\gpc_temp1.cpp:83: error: expected `;' before "good"
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 2.9 sec. Time: 00:18
Build: 0 succeeded.
*** 1 FAILED ***

62
GLBasic - en / Re: SETTRANSPARENCY question
« on: 2015-Jun-04 »
Cheers I'll read through the link tonight if I'm not busy on call.

63
GLBasic - en / Re: SETTRANSPARENCY question
« on: 2015-Jun-03 »
Found out I can't change the 2nd layer as it ignores  the Settransparency, but if I save the first layer sprite to disc then change the transparency and load it then it works.
I need to do this in memory for speed. any Idea's

A PNG with a transparent mask cant have SETTRANSPARENCY function, well not for me anyway.
BMP works better.

This bit of code works but with disc uses.

Code: GLBasic [Select]
SETCURRENTDIR("Media") // go to media files
SETSCREEN 1366,768,0
ALPHAMODE -1
SETTRANSPARENCY RGB(255,3,129)  //inner font colour
//LOADFONT "your1111.png",3
LOADFONT "your1111.bmp",3
//SETTRANSPARENCY RGB(0,0,0)
//SETTRANSPARENCY RGB(255,255,255)

GLOBAL t
SETFONT 3,8
LOADSPRITE "back.jpg",10
DRAWSPRITE 10,0,0
PRINT "TEST TEST",0,500
GRABSPRITE 5,0,450,1366,300
SAVESPRITE "test.bmp",5
SETTRANSPARENCY RGB(129,129,129) //background colour
LOADSPRITE "test.bmp",6
SHOWSCREEN
KEYWAIT
DRAWSPRITE 10,0,0
DRAWSPRITE 6,0,0
SHOWSCREEN
KEYWAIT
 

64
GLBasic - en / SETTRANSPARENCY question
« on: 2015-Jun-02 »
I'm having trouble getting this working if its possible at all.
I can set transparency to any colour and overlay with no problems.
I then change the transparency to a different colour , grabsprite , then drawsprite to a new location in essence having 2 layer of transparency, how ever this bit never works no matter what i try.

what I am trying to do is have a font outline which is white and never changes.
the inside of the fonts in pink RGB255,0,128 and is draw over a background. this works
I then change the transparency to blue, grabsprite in the area I need which is the outside of the font background.
and draw it onto a new background.
however it always blue.(or the colour i picked)

Ive changed the colour
its A png image
ive tested the colour is saved right( Hence the bug I noticed in UO Dingsfont)
coded it in different orders but never works

Is it possible or Im I doing about it the wrong way.

cheers Paul


65
Don't know if this has been noticed as i haven't translated the pages but there is a Bug in the Green RGB value.
If I set background or outline etc to 255,0,128 the PNG always saves as 255,4,128 value. not a real problem but good to point out if your doing multiple transparencies .

But I do like this program, good work  :nw:


66
GLBasic - en / Re: Android Compile problems.
« on: 2015-Mar-12 »
Did a clean up this mornings and all is well. next time I'll read the instructions. will setup a fresh install on my main PC.

Cheers Spacefractal

67
GLBasic - en / Re: Android Compile problems.
« on: 2015-Mar-12 »

I'm getting this now,  dont even know what proguard is.I should have left well alone, I guess AE changed a lot of settings.
Oh well.Maybe spacefractal should put a warning saying "Not for idiots" on the download page


*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.053 SN:1e3d04c5 - 3D, NET
Wordcount:1240 commands
compile+link:
running glb_build.bat
Using ANDROID_TARGET="android-8"
You can use "C:\Users\PaulsLaptop\Documents\GLBasic\Andriod Reset\distribute\Android\glb_android_build.bat" to change the API level and SDK path.
%ANDROIDSDK% not set. Using GLBasic's default target-8, Android 2.2



BUILD STAGE 1: Compile and pack RELEASE
Updated project.properties
Updated local.properties
Updated file C:\Users\PaulsLaptop\Documents\GLBasic\Andriod Reset\distribute\Android\build.xml
Updated file C:\Users\PaulsLaptop\Documents\GLBasic\Andriod Reset\distribute\Android\proguard.cfg
It seems that there are sub-projects. If you want to update them
please use the --subprojects parameter.

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:539: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:568: null returned: 1

Total time: 2 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG and install on device
     [echo] Gathering info for glbasic...
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Handling aidl files...
     [echo] ----------
     [echo] Handling RenderScript files...
     [echo] ----------
     [echo] Handling Resources...

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:539: The following error occurred while executing this line:
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\build.xml:568: null returned: 1

Total time: 2 seconds
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\Users\PaulsLaptop\Documents\GLBasic\Andriod Reset\distribute\Android
success
_______________________________________
*** Finished ***
Elapsed: 24.4 sec. Time: 22:43
Build: 1 succeeded.

68
GLBasic - en / Android Compile problems.
« on: 2015-Mar-11 »
Installed Android extras as i was curious, and now messed up my settings.
I've uninstalled it which logged 100s of non declared items errors when compiling.
I've reinstalled GLB which has fixed this but now I can't point the compile to my phone
any idea where this is configured.
I dont really want to wipe this laptop.
cheers

69
Off Topic / Re: LG webos TV is .....
« on: 2014-Nov-17 »
Webos is good for open apps
E.g watch something on YouTube then open Amazon then open Netflix etc , it pauses the app until you return  similar to android
Ideal for playing on Xbox then jumping on to YouTube to find a walkthrough.
All other smart TVs I've tried take up to a minute to even startup the so called smart menu,then the app has to close to open the next app.

Not saying it the best TV in the world, the good points out weigh the bad.
Has a slight picture twitch every now and again. Something to do with the upscaler I think.
My wife think the old TV had better sound.
SD can look worse
BBC HD can look good to amazing,wildlife shows stand out so far

70
Off Topic / Re: LG webos TV is .....
« on: 2014-Nov-17 »
Had a Samsung for 8 years, just started to play up.
have a LG 4k webos TV, only had it a week.
3D is great as 1080p TVs split the screen to 540 line for left and 540 for right.
The 4k shows 2x1080p at same time.

dual band WiFi, had no problems yet. Have it set to 5ghz


Start up time is 5 seconds to picture on
Then up to 20 seconds for webos menu to be active.
Menu is good always check for update on the app using
Has crashed once already
.
4k picture is excellent , through YouTube 4k videos.

Making you own 4k files that work can be tricky.
You need 4k footage( I use power director 12)
Handbrake nightly build ( has H265/HEVC )
Make A mkv with h265 Dolby 5.1
Stick it on a USB drive . it won't work through network servers no sure why.

Not started messing with webos builds yet but I'm sure I will have the TV broke in a few weeks

71
Code Snippets / Dizzy Spinning Circles
« on: 2014-Oct-19 »
Again how  Quick simple Code can produce good results.
My take on the Circle part in Second Reality.
Code probably useless, but fun


Code: GLBasic [Select]
// future Crew Second Reality style Circles
// First Version created 5 circle sprites with a palatte rotation but I didn't like it

SETSCREEN 1024,768,1                            //runs better in fullscreen mode
GLOBAL a, r,i,b
SETFONT 0,4
PRINT " Please wait slow rendering...",30,20
SHOWSCREEN
LIMITFPS 60


GOSUB picbuild                                 //Render Circles

GOSUB spriteline                               //Break sprite into 768 sprites lines

b= 180
WHILE TRUE
i= i+ 4                                       // 1st circle Speed clockwise
b= b +3                                       // 2nd circle Speed clockwise
ALPHAMODE -1
ZOOMSPRITE 7777,100*SIN(i)+0,100*COS(i)+0,1.5,1.5                  // Draw 1st Circle. zoomsprite higher then screen or edges will show
ALPHAMODE 0.9
IF i> 1000 THEN ZOOMSPRITE 1000,100*SIN(b)+0,100*COS(b)+0,1.5,1.5 // Draw 2nd Circle once i>1000

SHOWSCREEN
IF i> 3000 THEN GOSUB flow                    // bend sprite 1000 once i>3000

WEND
KEYWAIT




// wobble the picture
SUB flow:
              FOR y=1 TO 768
              a=a +0.001 * 6                // Wobble speed
              DRAWSPRITE y, COS( a + y ) * y / 4, y
              NEXT
              GRABSPRITE 1000,0,0,1024,768 // Grab whole screen
              RETURN
ENDSUB

// Draw the circles

SUB picbuild:
r = 0
FOR j= 0 TO 650
r=r + 15
IF r > 400 THEN r = 0
FOR i=0 TO 360 STEP 0.1                   // Higher the step the more missed pixels + faster render
SETPIXEL j*SIN(i) + 1024 /2, j*COS(i)+768 /2, RGB(r/3, r/3, r/3)   // PLot a dot
NEXT                                                                                                                            
NEXT


// Grab Whole screen
GRABSPRITE 7777,0,0,1024,768             // Grab the same picture twice
GRABSPRITE 1000,0,0,1024,768

RETURN
ENDSUB

SUB spriteline:
FOR t = 1 TO 768
GRABSPRITE t,1,t,1024,1                 //grab 1 line from top to bottom, 1024 pixels wide * 768
NEXT
RETURN
ENDSUB


 

72
didn't LG buy/Licence  WebOS from HP and use it in all there TVs?

73
Code Snippets / Animated 3D cube (fake Plasma)
« on: 2014-Oct-15 »
Fake Plasma Rotating Cube ( Grabsprite abuse )

show.exe in zip shows sides being rendered on the fly
plasmacube.exe normal

not optimized, probably better ways to do this but an easy example.

wobble screen maths may be useful for other project and is quite simple, took me a bit to get it right.
dicecube.ddd made in ac3d.



Code: GLBasic [Select]
SETCURRENTDIR("Media") // go to media files
GLOBAL xxx,a
LOADFONT "smalfont.png", 1
SETFONT 1,1.5
LIMITFPS 40


//LOAD IMAGES
X_LOADOBJ "dicecube.ddd", 0
LOADSPRITE "blue.jpg",9999
LOADSPRITE "orange.jpg", 6000
LOADSPRITE "test.jpg",5000

//------------------------------------------------------------------
// GRAB LOT OF SPRITE LINES
STRETCHSPRITE 6000,0,0,1024,768
FOR t = 1 TO 768
GRABSPRITE t+6001,1,t,1024,1
NEXT

STRETCHSPRITE 5000,0,0,1024,768
FOR t = 1 TO 768
GRABSPRITE t+5001,1,t,1024,1
NEXT

STRETCHSPRITE 9999,0,0,1024,768
FOR t = 1 TO 768
GRABSPRITE t+30,1,t,1024,1
NEXT

//----------------------------------------------------------------------
// SHOW ROTATE TEXTURE CUBE

WHILE TRUE
xxx = xxx + 3
GOSUB side3
//CLEARSCREEN   TURN THIS ON FOR NO BACKGROUND ( SHOW SECRET )
PRINT "X:" + xxx, 100, 10
X_MAKE3D 1, 50, 45
X_CAMERA 4, 0, 0, 0, 0, 0
X_SETTEXTURE 0, -1
X_ROTATION xxx, xxx/ 2, xxx / 2, 0
X_DRAWOBJ 0,0
IF xxx > 360 THEN xxx = 0
SHOWSCREEN
WEND


//-----------------------------------------------------------------------

SUB side3:



            FOR y=1 TO 768
                a=a + 0.005 * 2   // * SPEED
            DRAWSPRITE y, COS( a + y ) * y /4, y      // WOBBLE THE LINES
            NEXT

                GRABSPRITE 9998,200,150,500,500                   // GRAB THE WOBBLED SCREEN
            DRAWSPRITE 0,0,0                                              // DRAW THE TEXTURE
         STRETCHSPRITE 9998,340,170,170,170                       // DRAW 1 SIDE
         STRETCHSPRITE 9998,0,170,170,170                         // DRAW 1 SIDE SAME IMAGE
         GRABSPRITE 0,0,0,512,512                                         // GRAB NEW TEXTURE
  //-----------------------------------------------------------------------

         FOR y=1 TO 768
         a=a + 0.005 * 2
         DRAWSPRITE y+6001, COS( a + y ) * y/4, y
         NEXT
         GRABSPRITE 9997,200,150,500,500
         DRAWSPRITE 0,0,0
         STRETCHSPRITE 9997,170,0,170,170
         STRETCHSPRITE 9997,170,340,170,170
         GRABSPRITE 0,0,0,512,512

 //------------------------------------------------------------------------
            FOR y=1 TO 768
            a=a + 0.005 * 2
            DRAWSPRITE y+5001, COS( a+ y ) *y/4, y
                NEXT
                GRABSPRITE 9998,200,150,500,500
            DRAWSPRITE 0,0,0
            STRETCHSPRITE 9998,340,340,170,170
            STRETCHSPRITE 9998,170,170,170,170
            GRABSPRITE 0,0,0,512,512
                        RETURN
ENDSUB
 

74
Beta Tests / Re: 2 Future Crew style effects
« on: 2014-Oct-15 »
I did map the image on a 512x512 this it just a typo, i'll fix it now. cheers

75
Beta Tests / Re: 2 Future Crew style effects
« on: 2014-Oct-15 »
I guess 99% of you worked out how this was done.I recall someone asking about this ages ago.so this was my take with animation.

The cube was made using AC3D, I then drawn a picture 512x512 with a 3x3 grid 170x170. Using AC3D texture coordinate editor mapped each side to a grid position. save it as .ddd
not sure how easy this is if you built the cube from Code and tried to map it, maybe someone with more experience could shed some light?

The program load 3 sprite pictures(plasma )
stretches the images and grabs a sprite per line. e.g 320x200 would grab 200 sprites 320x1 and does this 3x

using cosine maths it wobbles the whole screen and grabs an image for 2  sides. again 3x
then all is written to the grid  in different  location then grabbed as the texture  map

Pages: 1 ... 3 4 [5] 6 7