Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 6th Mar 2013 13:17 Edited at: 6th Mar 2013 15:24
Hi there i've got a problem with memblocks.I'm new to them and i don't know much of how they work.What i'm trying to do is erase and draw back effect.Erasing part is done.I'm not sure how to draw back the image line by line from bottom to top.I tried with using second memblock to read from but result was instantaneous draw.



EDIT:
Nevermind i solve the problem.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 6th Mar 2013 15:37
Solution if anyone is concerned:



Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 7th Mar 2013 06:04 Edited at: 7th Mar 2013 06:06
I was just mucking around with your code and noticed something odd: the second image is scaled up, I remmed out most of the program and it still happens, I don't understand this nothing is happening other than making a memblock from the image then making an image from the memblock. I have no idea why the data is being distorted?



Or stripped right down:

What the hell?


xCept
23
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 7th Mar 2013 08:09 Edited at: 7th Mar 2013 08:10
@OBese87, by default Get Image prepares the image as if it were to be used as a texture which can cause some scaling artifacts. Appending ", 1" to the end of it solves this issue:



(If the image is a multiple of 2 I think it will be fine even without the texture flag but haven't tested that).
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 7th Mar 2013 12:42
The image i was using was multiple of 2, there was no distortion.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Mar 2013 22:32 Edited at: 9th Mar 2013 22:56
Quote: "@OBese87, by default Get Image prepares the image as if it were to be used as a texture which can cause some scaling artifacts. Appending ", 1" to the end of it solves this issue:"

Thanks. Grrr! Why does DBP mess with images by default? I checked the help file because I know this happens with saving images but it said absolutely nothing about it in the GET IMAGE entry. I thought this language was supposed to be for beginners but it is so horribly inconsistent that I find myself trying totally illogical bug fixes because I know how illogical the language is.

Why is it mousex() but camera position x()? Why OPEN FILE [file number],[filename] but LOAD IMAGE [filename],[image number]? Why WRITE MEMBLOCK BYTE Memblock Number, Position, Byte but MEMBLOCK BYTE(Memblock Number, Position)!? Why isn't "READ" at the front of the READ MEMBLOCK BYTE command so it has the same syntax as "WRITE MEMBLOCK BYTE"? And why is there this misleading idea throughout the language that parenthesis means a value will be returned!?

I'm annoyed because I like this language, it was my first, but now I'm finding out that it has taught me a lot of bad habits and false ideas about programming. I still like the premise of DarkBasic but it is executed so poorly that it really doesn't achieve its potential. I hope the AppGameKit language is better and more consistent.

After that rant, here are some ideas I had that might improve the structure of commands to help beginners:

Instead of MAKE OBJECT BOX 1,10,20,30 and MAKE OBJECT 1,1 how about: MAKE OBJECT 1 AS BOX 10,20,30 and MAKE OBJECT 1 FROM MESH 1

I see the infamous SET OBJECT command has its parameters as additional separate commands in DBP but why not combine these into a flexible command,
eg: SET OBJECT 5 AMBIENT ON, WIREFRAME OFF, CULL OFF, FOG OFF so the arbitrary parameter order doesn't have to be memorized yet multiple parameters can still be set in one command call. My example could easily be parsed and converted to SET OBJECT 5,0,1,0,1,1,0,1 so this could even be done by an IDE.


Mr Kohlenstoff
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Germany
Posted: 10th Mar 2013 12:40 Edited at: 10th Mar 2013 12:42
I totally see what you mean OBese87. The commands tend to be confusing at times. And there are many other (imho much more important) problems with the language, such as the lack of flexibility when it comes to types and arrays, or the limits of user functions (no overloading or default values for example).

However, regarding the more or less arbitrary parameter lists - doesn't your IDE tell you which parameters are required? That pretty much solves the problem. Also, although your suggestion to use commands in the form of "make object X from mesh Y" might be more intuitive than "make object from mesh X, Y", it's also less consistent. Currently the user at least knows the usual syntax:
<command name> <parameters> or
return value = <function name>( <parameters> )

luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 10th Mar 2013 15:24 Edited at: 10th Mar 2013 15:27
Hi guys,
i've got another problem now.I made a slider because my intention is to use this for scrolling inventory and i can't figure out how to manage the sprite properly.If i use slider(1, 264,100, 200, 20, 0, 64) then sprite is hidden once and i don't know how to draw it back.If i use slider(1, 264,100, 200, 20, -64, 64) it's hidden at one place and showed at another.I keep messing arround and can't find the solution.Also if you use -64 and scroll fast it cut's the sprite in pieces.Here is the code:


Coding is My Kung Fu!
And My Kung Fu is better than Yours!
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 11th Mar 2013 12:00
Quote: "although your suggestion to use commands in the form of "make object X from mesh Y" might be more intuitive than "make object from mesh X, Y", it's also less consistent. Currently the user at least knows the usual syntax:
<command name> <parameters> or
return value = <function name>( <parameters> ) "

I think it's more consistent because it uses the same "MAKE OBJECT [object number]..." syntax no matter what type of object you are creating. I think this approach would be much easier to learn.

@Luskos
This code is pretty old and I haven't checked it over but maybe it will help:



luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 11th Mar 2013 15:43
Thank you, but i think just need a way to know if the scrollbar is going up or down, i.e. i need to compare last position with the current position of sliders().value.I didn't examine why the slider in your code isn't working, but anyway i allready have something simmilar for text.

Coding is My Kung Fu!
And My Kung Fu is better than Yours!
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 11th Mar 2013 17:18 Edited at: 11th Mar 2013 19:11
It's completed now.Here how i did it.Thank you all for the help.I'll post clean version when i'm done with it.This is working but messy.


Coding is My Kung Fu!
And My Kung Fu is better than Yours!

Login to post a reply

Server time is: 2026-07-07 14:23:57
Your offset time is: 2026-07-07 14:23:57