Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

barreytor

Members
  • Posts

    69
  • Joined

  • Last visited

    Never

Posts posted by barreytor

  1. I was going to make one right when I saw the thread, then thought of giving advice and then left because I wasn't logged in.

    Yeah, too much backstory for a request… that I kind of forgot.

    So, what about a robot with a top hat?
  2. Okay, lemme just… Here:
    >! ```
    >! //config
    >! //set default images view mode
    >! $defaultViewMode="full"; //full, normal, original
    >! $tsMargin=30; //first and last thumbnail margin (for better cursor interaction)
    >! $scrollEasing=600; //scroll easing amount (0 for no easing)
    >! $scrollEasingType="easeOutCirc"; //scroll easing type
    >! $thumbnailsContainerOpacity=0.8; //thumbnails area default opacity
    >! $thumbnailsContainerMouseOutOpacity=0; //thumbnails area opacity on mouse out
    >! $thumbnailsOpacity=0.6; //thumbnails default opacity
    >! $nextPrevBtnsInitState="show"; //next/previous image buttons initial state ("hide" or "show")
    >! $keyboardNavigation="on"; //enable/disable keyboard navigation ("on" or "off")
    >! //cache vars
    >! $thumbnails_wrapper=$("#thumbnails_wrapper");
    >! $outer_container=$("#outer_container");
    >! $thumbScroller=$(".thumbScroller");
    >! $thumbScroller_container=$(".thumbScroller .container");
    >! $thumbScroller_content=$(".thumbScroller .content");
    >! $thumbScroller_thumb=$(".thumbScroller .thumb");
    >! $preloader=$("#preloader");
    >! $toolbar=$("#toolbar");
    >! $toolbar_a=$("#toolbar a");
    >! $bgimg=$("#bgimg");
    >! $img_title=$("#img_title");
    >! $nextImageBtn=$(".nextImageBtn");
    >! $prevImageBtn=$(".prevImageBtn");
    >! $(window).load(function() {
    >! $toolbar.data("imageViewMode",$defaultViewMode); //default view mode
    >! if($defaultViewMode=="full"){
    >! $toolbar_a.html("![](images/toolbar_n_icon.png)").attr("onclick", "ImageViewMode('normal');return false").attr("title", "Restore");
    >! } else {
    >! $toolbar_a.html("![](images/toolbar_fs_icon.png)").attr("onclick", "ImageViewMode('full');return false").attr("title", "Maximize");
    >! }
    >! ShowHideNextPrev($nextPrevBtnsInitState);
    >! //thumbnail scroller
    >! $thumbScroller_container.css("marginLeft",$tsMargin+"px"); //add margin
    >! sliderLeft=$thumbScroller_container.position().left;
    >! sliderWidth=$outer_container.width();
    >! $thumbScroller.css("width",sliderWidth);
    >! var totalContent=0;
    >! var autoScrolling = true;
    >! fadeSpeed=200;
    >! var $the_outer_container=document.getElementById("outer_container");
    >! var $placement=findPos($the_outer_container);
    >! $thumbScroller_content.each(function () {
    >! var $this=$(this);
    >! totalContent+=$this.innerWidth();
    >! $thumbScroller_container.css("width",totalContent);
    >! $this.children().children().children(".thumb").fadeTo(fadeSpeed, $thumbnailsOpacity);
    >! });
    >! $thumbScroller.mousemove(function(e){
    >! if($thumbScroller_container.width()>sliderWidth){
    >! var mouseCoords=(e.pageX - $placement[1]);
    >! var mousePercentX=mouseCoords/sliderWidth;
    >! var destX=-((((totalContent+($tsMargin*2))-(sliderWidth))-sliderWidth)*(mousePercentX));
    >! var thePosA=mouseCoords-destX;
    >! var thePosB=destX-mouseCoords;
    >! if(mouseCoords>destX){
    >! $thumbScroller_container.stop().animate({left: -thePosA}, $scrollEasing,$scrollEasingType); //with easing
    >! } else if(mouseCoords picHeight) {
    >! $(theItem).attr("width",winWidth);
    >! $(theItem).attr("height",picHeight*winWidth);
    >! } else {
    >! $(theItem).attr("height",winHeight);
    >! $(theItem).attr("width",picWidth*winHeight);
    >! };
    >! }
    >! $(theItem).css("margin-left",(winWidth-$(theItem).width())/2);
    >! $(theItem).css("margin-top",(winHeight-$(theItem).height())/2);
    >! } else { //no scale
    >! $(theItem).attr("width",imageWidth);
    >! $(theItem).attr("height",imageHeight);
    >! $(theItem).css("margin-left",(winWidth-imageWidth)/2);
    >! $(theItem).css("margin-top",(winHeight-imageHeight)/2);
    >! }
    >! }
    >! //Image view mode function - fullscreen or normal size
    >! function ImageViewMode(theMode){
    >! $toolbar.data("imageViewMode", theMode);
    >! FullScreenBackground($bgimg,$bgimg.data("newImageW"),$bgimg.data("newImageH"));
    >! if(theMode=="full"){
    >! $toolbar_a.html("![](images/toolbar_n_icon.png)").attr("onclick", "ImageViewMode('normal');return false").attr("title", "Restore");
    >! } else {
    >! $toolbar_a.html("![](images/toolbar_fs_icon.png)").attr("onclick", "ImageViewMode('full');return false").attr("title", "Maximize");
    >! }
    >! }
    >! //function to find element Position
    >! function findPos(obj) {
    >! var curleft = curtop = 0;
    >! if (obj.offsetParent) {
    >! curleft = obj.offsetLeft
    >! curtop = obj.offsetTop
    >! while (obj = obj.offsetParent) {
    >! curleft += obj.offsetLeft
    >! curtop += obj.offsetTop
    >! }
    >! }
    >! return [curtop, curleft];
    >! }
    >! //function to jump to next image
    >! function jumpNextImage(){
    >! if(!autoScrolling) return false;
    >! SwitchImage($outer_container.data("nextImage"));
    >! var $this=$("#outer_container a[href='"+$outer_container.data("nextImage")+"']");
    >! GetNextPrevImages($this);
    >! GetImageTitle($this);
    >! return false;
    >! }

    ```

    as I said before, this is untested and may not work, but it's all I can really do.
  3. Well, in theory what you want is simple, though this is largely untested and might not do what you want it to, it might help somewhat.

    Begin by making a backup copy of the script.

    First of all would be adding a new function```

    //function to jump to next image

    function jumpNextImage(){

    if(!autoScrolling) return false;

    SwitchImage($outer_container.data("nextImage"));

    var $this=$("#outer_container a[href='"+$outer_container.data("nextImage")+"']");

    GetNextPrevImages($this);

    GetImageTitle($this);

    return false;

    }

    ```It's just a copy from the "keypress goes to next image", just with another name, then somewhere up around there, maybe under```
    var totalContent = 0;
    ```you'll need to add something along the lines of```

    var autoScrolling = true;

    ```and lastly, just after this piece of code, but before the closing tags:```

    //load 1st image

    var the1stImg = new Image();

    the1stImg.onload = CreateDelegate(the1stImg, theNewImg_onload);

    the1stImg.src = $bgimg.attr("src");

    $outer_container.data("nextImage",$(".content").first().next().find("a").attr("href"));

    $outer_container.data("prevImage",$(".content").last().find("a").attr("href"));

    //That would be right here, lines 109~110

    });

    ```
    you just have to add```

    var interval = setInterval(jumpNextImage, 10000);

    ```where 10000 is the time in milliseconds, change it to whatever you want it to be (like 30000 for 30 seconds).

    Of course, you'd have to add a line of```

    autoScrolling = false;

    ```inside the methods that change an image because user input. You can find them by looking for the following:```

    //Each of these lines refers to a different line in the code.

    if(ev.keyCode == 39) {

    else if(ev.keyCode == 37) {

    $prevImageBtn.click(function(event){

    $nextImageBtn.click(function(event){

    $("#outer_container a").click(function(event){

    ```just add the autoscrolling=false in the line after each of those and it should work.

    Aaaand I think that's it. I don't really have much idea, but I sure hope I went somewhat around the right way.

    And if it doesn't work, you can always restore form that backup you made at the start, right?
  4. Ugh, so many typos… I'll try to say it in a way that you can comprehend:

    Aprender a programar puede ser dificil, pero si la idea que llevas es montar algo como el EO pero para otras plataformas/moviles y tablets, no te va a quedar otra opcion que empezar de cero. Y no esperes poder montar un grupo de programadores asi por las buenas.

    > Learning to code may be hard, but if your idea is building something like EO but for other platforms/smartphones and tablets, you don't have other choice but to start from scratch. And don't expect to be able to put together a group of programmers easily.
  5. You could always, you know, start from scratch in whatever language you want to use and use EO as a reference on how to do the stuff.

    It'll be pretty hard, if not outright impossible, to find a free, open source mmorpg engine like EO in a language that can run in smartphones and PC alike.
  6. Sorry to break it to you, but I already did the whole "Make EO 2.0 load png instead of bmp", and it was basically the only thing I did before finding that EO 3.0 existed.

    [http://www.touchofdeathforums.com/community/index.php?/topic/128361-eo-20-load-from-png-instead-of-bmp/](http://www.touchofdeathforums.com/community/index.php?/topic/128361-eo-20-load-from-png-instead-of-bmp/)

    Huh, checked it, had to go through and reupload the attached files. Nevermind, don't waste your time, it's already done.
  7. > Note to everyone; This does not and will not ever add proper PNG support.

    And that's why I switched to EO 3.0, though I did that after going ALL the way to find a way to find a way to be able to load PNG with EO 2.3\. Though it's a whole lot cleaner than the first try I went through (I saved a converted bitmap, then loaded THAT), it will indeed be a performance hit.

    I just posted this here because I thought it be of some use for someone.

    > Well you are adding 3 modules full of code.. not sure if its all used cause it looks to be ripped from something else but still may be wasteful.. I had been using ths on my lower end pc to map with no visible issues. I'll probably just remove it before i release the game.. if anyone else could maybe download the files and take a look any info would be helpful.

    The modules are just the parsers that load and convert other image formats to PNG on memory. I didn't tamper with them, and they don't seem to have any malicious code, but as I said before, I just left this and went to EO 3.0 with it's DX8 and proper, native PNG support.
  8. @Dawntide:

    > Does it increase the quality of the sprites, so i can make them larger without messing the quality up so hard?
    > How you create transparent things, for example an icon, same way as with .bmp?

    I think you're asking if zoomed sprites will look better. They won't look any better than they do in BMP, and nothing you can do to a sprite will make it have a better quality when zoomed in.
    As for the transparent things question: Yes, do the same way as if it was a BMP.

    In fact, when using this tutorial don't think of PNGs as PNGs, but as BMPs that use roughly a tenth of the  disk space.
  9. Well, that's the catch: You can't get any good use of the alpha channel as DirectDraw7 doesn't support it.
    The method is more to get the bulk of the space used by the graphics cut down without losing any quality.
    Make sure the tiles that are supposed to be transparent don't have any transparency gradient. That is: treat them as you would plain BMPs, only smaller filesize.
  10. Damnit. Forgot about that. Editing this in a minute with that other absolutely neccesary step I somehow forgot.

    EDIT: Okay, edited the original post with this simple step that's the cause of your problem there: "Then, after adding everything, open the menu "Project->References", find "Ole automation" and activate it."

    You just have to open "Project->References" and activate OLE Automation.
  11. The atacched, and needed, files: http://www.mediafire.com/download.php?os377d5nyfes596

    So, this is my very first post in this forum, and I would like to use it to share the very first thing I did just after downloading Eclipse Origins 2.3 Event system: Loading all the graphics from PNGs instead of BMPs.

    It was kind of a quick, dirty job, and it doesn't allow you to use the alpha channel, but an overall 90% reduction in the actual filesize makes me think it's worth mentioning here.

    (And basically it's the only thing I did until I found and downloaded EO 3.0 with DX8, but that's unrelated)

    So, if you want to use the light PNG graphics format with your DirectDraw7 powered Eclipse Origins project, here are the steps:

    **All client side**

    First of all, download the attached zip and add all of the classes and modules to your client source.

    Then, after adding everything, open the menu "Project->References", find "Ole automation" and activate it.

    Second, find this:```
    ' load persistent surfaces
    ```in your modDirectDraw7 and change the extension from all files from ".bmp" to ".png"

    Then, in modConstants, replace```
    Public Const GFX_EXT As String = ".bmp"
    ```with```
    Public Const GFX_EXT As String = ".png"
    ```

    And now, for the real meat. Go back to modDirectDraw7 and, under```
    Public NumFaces as Long
    ```add```
    Private cImage As c32bppDIB
    ```

    Next, go to the```
    InitDDSurf
    ```sub, and replace

    ```
    ' set flags

    SurfDesc.lFlags = DDSD_CAPS

    SurfDesc.ddsCaps.lCaps = DDSD_Temp.ddsCaps.lCaps

    ' init object

    Set Surf = DD.CreateSurfaceFromFile(fileName, SurfDesc)
    ```with```
    ' set flags

    SurfDesc.lFlags = DDSD_CAPS Or DDSD_WIDTH Or DDSD_HEIGHT

    SurfDesc.ddsCaps.lCaps = DDSD_Temp.ddsCaps.lCaps

    ' init object

    ' Set Surf = DD.CreateSurfaceFromFile(FileName, SurfDesc)

    Set cImage = New c32bppDIB

    cImage.LoadPicture_File (fileName)

    SurfDesc.lWidth = cImage.Width

    SurfDesc.lHeight = cImage.Height

    Set Surf = DD.CreateSurface(SurfDesc)

    Dim DC

    DC = Surf.GetDC

    cImage.Render (DC)

    Surf.ReleaseDC (DC)

    cImage.DestroyDIB
    ```

    And that's that! Now you can load your image files from PNGs instead of BMPs… Only alpha channels won't do anything. (except for fully transparent pixels, for which, if I recall correctly, it DID work. Either that or the mask color system, which is still used)

    For the task of mass changing the format, use something like PNGGauntlet or other.
×
×
  • Create New...